GLHUI: Open OpenGL context windows in X11 with libX11

[ bsd3, graphics, library ] [ Propose Tags ]

Haskell functions to open and manage a OpenGL window with libX11.

This module is intended to be imported qualified, to avoid clashes with Prelude functions, e.g.

import qualified Graphics.UI.GLWindow as Window

As an example, here is a simple module that uses some of these functions to open a OpenGL 3.2 Context:

module Main where

import Graphics.Rendering.OpenGL
import qualified Graphics.UI.GLWindow as Window

myLoop = do clear [ColorBuffer]
            t <- Window.time
            clearColor $= Color4 (sin (realToFrac t) * 0.5 + 0.5)
                                 (sin (realToFrac (t+1)) * 0.5 + 0.5)
                                 (sin (realToFrac (t+2)) * 0.5 +0.5)
                                 0

main = do Window.init 3 2 -- initializes a OpenGL 3.2 context
          Window.loop myLoop -- stops when the ESC key is pressed
          Window.kill -- removes the window when the loop stops

Special thanks to Tiago Farto (aka xernobyl) for coding the C version of these functions


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0, 1.1.0
Dependencies base (<5) [details]
License BSD-3-Clause
Copyright Hugo Gomes
Author Hugo Gomes <mr.hugo.gomes@gmail.com>
Maintainer Hugo Gomes <mr.hugo.gomes@gmail.com>
Category Graphics
Home page http://www.hackological.com/projects/GLHUI
Uploaded by HugoGomes at 2011-04-30T02:40:41Z
Distributions NixOS:1.1.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2352 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for GLHUI-1.0.0

[back to package description]