Migrated to OpenGL3.x - compiles but renders nothing

- added simple shader
- rewrote map to cater BufferArray
- completele rewrote Main
- Split off stuff into Render-Module
- cleaned up .cabal-file to bare minimum
- created RenderObjects for the purpose of moving rendering there
This commit is contained in:
Stefan Dresselhaus
2014-01-03 03:01:54 +01:00
parent 306381c4ed
commit e5193fc7c5
9 changed files with 1225 additions and 535 deletions

View File

@ -33,7 +33,7 @@ initBuffer varray =
checkError "initBuffer"
return bufferObject
initShader :: IO (UniformLocation, AttribLocation, AttribLocation)
initShader :: IO (AttribLocation, AttribLocation, AttribLocation, UniformLocation)
initShader = do
! vertexSource <- B.readFile vertexShaderFile
! fragmentSource <- B.readFile fragmentShaderFile
@ -50,8 +50,12 @@ initShader = do
vertexIndex <- get (attribLocation program "fg_Vertex")
vertexAttribArray vertexIndex $= Enabled
normalIndex <- get (attribLocation program "fg_Normal")
vertexAttribArray normalIndex $= Enabled
checkError "initShader"
return (projectionMatrixIndex, colorIndex, vertexIndex)
return (colorIndex, normalIndex, vertexIndex, projectionMatrixIndex)
initRendering :: IO ()
initRendering = do