Forgot to init the GL-Context -.-

This commit is contained in:
Nicole Dresselhaus 2014-01-20 19:42:49 +01:00
parent ce055339ec
commit 60346766fd

View File

@ -50,6 +50,7 @@ data Env = Env
, envWindow :: !Window , envWindow :: !Window
, envZDistClosest :: !Double , envZDistClosest :: !Double
, envZDistFarthest :: !Double , envZDistFarthest :: !Double
--, envGLContext :: !GLContext
} }
--Mutable State --Mutable State
@ -91,13 +92,14 @@ type Pioneers = RWST Env () State IO
main :: IO () main :: IO ()
main = do main = do
SDL.withInit [InitVideo, InitAudio] $ do --also: InitNoParachute -> faster, without parachute! SDL.withInit [InitVideo, InitAudio] $ do --also: InitNoParachute -> faster, without parachute!
window <- SDL.createWindow "Pioneers" (Position 1500 100) (Size 1024 768) [WindowOpengl -- we want openGL SDL.withWindow "Pioneers" (Position 1500 100) (Size 1024 768) [WindowOpengl -- we want openGL
,WindowShown -- window should be visible ,WindowShown -- window should be visible
,WindowResizable -- and resizable ,WindowResizable -- and resizable
,WindowInputFocus -- focused (=> active) ,WindowInputFocus -- focused (=> active)
,WindowMouseFocus -- Mouse into it ,WindowMouseFocus -- Mouse into it
--,WindowInputGrabbed-- never let go of input (KB/Mouse) --,WindowInputGrabbed-- never let go of input (KB/Mouse)
] ] $ \window -> do
withOpenGL window $ do
(Size fbWidth fbHeight) <- glGetDrawableSize window (Size fbWidth fbHeight) <- glGetDrawableSize window
initRendering initRendering
--generate map vertices --generate map vertices