flickering triangle (rendering cube)
This commit is contained in:
		| @@ -33,7 +33,7 @@ initBuffer varray = | ||||
|            checkError "initBuffer" | ||||
|            return bufferObject | ||||
|  | ||||
| initShader :: IO (AttribLocation, AttribLocation, AttribLocation, UniformLocation) | ||||
| initShader :: IO (AttribLocation, UniformLocation) | ||||
| initShader = do | ||||
|    ! vertexSource <- B.readFile vertexShaderFile | ||||
|    ! fragmentSource <- B.readFile fragmentShaderFile | ||||
| @@ -49,20 +49,12 @@ initShader = do | ||||
|    projectionMatrixIndex <- get (uniformLocation program "fg_ProjectionMatrix") | ||||
|    checkError "projMat" | ||||
|  | ||||
|    colorIndex <- get (attribLocation program "fg_Color") | ||||
|    vertexAttribArray colorIndex $= Enabled | ||||
|    checkError "colorInd" | ||||
|  | ||||
|    normalIndex <- get (attribLocation program "fg_Normal") | ||||
|    vertexAttribArray normalIndex $= Enabled | ||||
|    checkError "normalInd" | ||||
|  | ||||
|    vertexIndex <- get (attribLocation program "fg_VertexIn") | ||||
|    vertexAttribArray vertexIndex $= Enabled | ||||
|    checkError "vertexInd" | ||||
|  | ||||
|    checkError "initShader" | ||||
|    return (colorIndex, normalIndex, vertexIndex, projectionMatrixIndex) | ||||
|    return (vertexIndex, projectionMatrixIndex) | ||||
|  | ||||
| initRendering :: IO () | ||||
| initRendering = do | ||||
|   | ||||
		Reference in New Issue
	
	Block a user