iqm still does not render, starts again.

This commit is contained in:
Stefan Dresselhaus
2014-05-16 09:10:09 +02:00
parent a6efea80cf
commit da3a334121
8 changed files with 184 additions and 175 deletions

View File

@ -134,6 +134,8 @@ initMapShader tessFac (buf, vertDes) = do
let
objs = [MapObject testobj (L.V3 0 10 0) (MapObjectState ())]
currentProgram $= Nothing
! vertexSource' <- B.readFile objectVertexShaderFile
! fragmentSource' <- B.readFile objectFragmentShaderFile
vertexShader' <- compileShaderSource VertexShader vertexSource'
@ -145,6 +147,22 @@ initMapShader tessFac (buf, vertDes) = do
currentProgram $= Just objProgram
vertexIndex' <- get (attribLocation program "Position")
vertexAttribArray vertexIndex $= Enabled
checkError "Object-vertexInd"
normalIndex' <- get (attribLocation program "Normal")
vertexAttribArray normalIndex $= Enabled
checkError "Object-normalInd"
texIndex' <- get (attribLocation program "TexCoord")
vertexAttribArray colorIndex $= Enabled
checkError "Object-texInd"
att <- get (activeAttribs objProgram)
putStrLn $ unlines $ "Attributes: ":map show att
putStrLn $ unlines $ ["Indices: ", show (texIndex', normalIndex', vertexIndex')]
checkError "initShader"
let sdata = MapShaderData
{ shdrVertexIndex = vertexIndex