Refactor shaders, commit before major deletion of old code
This commit is contained in:
@@ -40,7 +40,11 @@ data FullShader = FullShader
|
||||
, _shaderVAO :: VAO
|
||||
, _shaderPokeStrategy :: RenderType -> [[[Float]]]-- -> F.FoldM IO RenderType Int
|
||||
, _shaderDrawPrimitive :: PrimitiveMode
|
||||
, _shaderTexture :: Maybe ShaderTexture
|
||||
}
|
||||
data ShaderTexture = ShaderTexture
|
||||
{ _textureObject :: TextureObject }
|
||||
|
||||
makeLenses ''VAO
|
||||
makeLenses ''FullShader
|
||||
|
||||
@@ -51,6 +55,10 @@ drawShaders fss is =
|
||||
where f fs i = do
|
||||
currentProgram $= Just (_shaderProgram fs)
|
||||
bindVertexArrayObject $= (Just (_vao $ _shaderVAO fs))
|
||||
case _shaderTexture fs of
|
||||
Just (ShaderTexture {_textureObject = to})
|
||||
-> textureBinding Texture2D $= Just to
|
||||
_ -> return ()
|
||||
drawArrays (_shaderDrawPrimitive fs) 0 (fromIntegral i)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user