From 60346766fd7898843ba9502724aeec4c048eaea2 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Mon, 20 Jan 2014 19:42:49 +0100 Subject: [PATCH] Forgot to init the GL-Context -.- --- src/Main.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index b8bd6b7..7ab9af4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -50,6 +50,7 @@ data Env = Env , envWindow :: !Window , envZDistClosest :: !Double , envZDistFarthest :: !Double + --, envGLContext :: !GLContext } --Mutable State @@ -91,13 +92,14 @@ type Pioneers = RWST Env () State IO main :: IO () main = do 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 ,WindowResizable -- and resizable ,WindowInputFocus -- focused (=> active) ,WindowMouseFocus -- Mouse into it --,WindowInputGrabbed-- never let go of input (KB/Mouse) - ] + ] $ \window -> do + withOpenGL window $ do (Size fbWidth fbHeight) <- glGetDrawableSize window initRendering --generate map vertices