Forgot to init the GL-Context -.-

This commit is contained in:
Nicole Dresselhaus 2014-01-20 19:42:49 +01:00
parent ce055339ec
commit 18c36491f8
2 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,8 @@ smooth out vec4 fg_SmoothColor;
void main() void main()
{ {
uiaenuirtdaend
vec3 fg_Normal = fg_NormalMatrix * fg_NormalIn; //vec3(0,1,0); vec3 fg_Normal = fg_NormalMatrix * fg_NormalIn; //vec3(0,1,0);
//transform vec3 into vec4, setting w to 1 //transform vec3 into vec4, setting w to 1
vec4 fg_Vertex = vec4(fg_VertexIn, 1.0); vec4 fg_Vertex = vec4(fg_VertexIn, 1.0);

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