From 18c36491f8f64d38a32301824ddece8ead1b2b35 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 -.- --- shaders/vertex.shader | 2 ++ src/Main.hs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shaders/vertex.shader b/shaders/vertex.shader index 324aa46..1778f2b 100644 --- a/shaders/vertex.shader +++ b/shaders/vertex.shader @@ -15,6 +15,8 @@ smooth out vec4 fg_SmoothColor; void main() { + +uiaenuirtdaend vec3 fg_Normal = fg_NormalMatrix * fg_NormalIn; //vec3(0,1,0); //transform vec3 into vec4, setting w to 1 vec4 fg_Vertex = vec4(fg_VertexIn, 1.0); 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