Reduce rendertype down to vertex information

This commit is contained in:
2021-07-27 13:35:43 +02:00
parent d27c5e7ff4
commit ae84f44824
14 changed files with 225 additions and 189 deletions
+24
View File
@@ -1,5 +1,6 @@
module Shader.Compile
( makeShader
, makeVShader
, makeShaderSized
, makeShaderUsingShaderVAO
, makeSourcedShader
@@ -16,6 +17,29 @@ import Control.Monad
--import Control.Lens
import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
{- |
Compiles a vertex shader found within the shader directory.
The shader is made up of files begining with the inputted string with extensions .vert, .geom etc.
-}
makeVShader
:: String -- ^ First part of the name of the shader
-> [ShaderType] -- ^ Filetype extensions
-> [Int] -- ^ The input vertex sizes
-> EPrimitiveMode
-> (VertexType -> Bool)
-> IO VShader
makeVShader s shaderlist sizes renStrat vtest = do
prog <- makeSourcedShader s shaderlist
vaob <- setupVAO sizes
return $ VShader
{ _vshaderProgram = prog
, _vshaderVAO = vaob
, _vshaderTexture = Nothing
, _vshaderCustomUnis = []
, _vshaderPokeTest = vtest
, _vshaderDrawPrimitive = renStrat
}
-- | Takes the VAO and poke strategy from another shader
makeShaderUsingShaderVAO
:: String -- ^ First part of the name of the shader