[HOpenGL] problem with displayCallback and Double buffering
Marc A. Ziegert
coeus at gmx.de
Wed Oct 29 00:49:07 EST 2003
does anyone else have this problem?
i want to use double buffering, but swapBuffers does not seem to work.
to set the active window to... the active window (i think that has to work!) does not work, too.
but i am able to compile and run glut examples with double buffering written in c.
coeus at titan ~/Documents/haskell/hopengl/problem $ ghc -package GLUT -package OpenGL first.hs -lglut
coeus at titan ~/Documents/haskell/hopengl/problem $ ./a.out
displayModePossible? ...True
begin swapBuffers
-------------- next part --------------
{-# OPTIONS -fglasgow-exts -fffi #-}
import Graphics.UI.GLUT
import Graphics.Rendering.OpenGL hiding (Double)
dc = do set [clearColor $= Color4 0 0 1 0]
clear [ColorBuffer,DepthBuffer]
--flush
--finish
putStrLn "begin swapBuffers"
swapBuffers
putStrLn "end swapBuffers"
return ()
main = do getArgsAndInitialize
set [initialDisplayMode $= [Double,Depth]]
b <- get displayModePossible
putStrLn $ "displayModePossible? ..." ++ show b
w <- createWindow "main"
set [displayCallback $= dc]
mainLoop
More information about the HOpenGL
mailing list