problem with displayCallback and Double buffering
"Marc A. Ziegert" <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.hopengl |
|---|---|
| Message-ID | <[email protected]> |
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@titan ~/Documents/haskell/hopengl/problem $ ghc -package GLUT -package OpenGL first.hs -lglut coeus@titan ~/Documents/haskell/hopengl/problem $ ./a.out displayModePossible? ...True begin swapBuffers _______________________________________________ HOpenGL mailing list [email protected] http://www.haskell.org/mailman/listinfo/hopengl
first.hs
(text/plain, 614 B)
{-# 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