Move shader compilation over to raw opengl, errors display incorrect

This commit is contained in:
2023-03-07 15:40:29 +00:00
parent e6ec46edce
commit 3e3fd049a9
12 changed files with 338 additions and 121 deletions
+10 -2
View File
@@ -33,9 +33,13 @@ module Shader.Data
, vert
, geom
, frag
, vert'
, geom'
, frag'
) where
import Data.Vector (Vector)
import Graphics.Rendering.OpenGL
import Graphics.GL.Core43
import Foreign
import Control.Lens
{- | Datatype containing the necessary information for a single shader. -}
@@ -47,11 +51,11 @@ data FullShader = FullShader
, _shadUnis :: Vector UniformLocation
}
data FullShader' = FullShader'
{ _shadProg' :: GLuint
{ _shadProg' :: GLuint -- should be shaderID
, _shadVAO' :: VAO
, _shadPrim' :: EPrimitiveMode
, _shadTex' :: Maybe ShaderTexture
, _shadUnis' :: Vector UniformLocation
, _shadUnis' :: Vector GLint
}
{- | Vertex array object: contains the reference to the object,
and its buffer targets. -}
@@ -96,6 +100,10 @@ vert, geom, frag :: ShaderType
vert = VertexShader
geom = GeometryShader
frag = FragmentShader
vert', geom', frag' :: GLenum
vert' = GL_VERTEX_SHADER
geom' = GL_GEOMETRY_SHADER
frag' = GL_FRAGMENT_SHADER
makeLenses ''VAO
makeLenses ''VBO
makeLenses ''FullShader