aboutsummaryrefslogtreecommitdiff
path: root/Spear/GL.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Spear/GL.hs')
-rw-r--r--Spear/GL.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Spear/GL.hs b/Spear/GL.hs
index 05e439a..eb84492 100644
--- a/Spear/GL.hs
+++ b/Spear/GL.hs
@@ -74,7 +74,7 @@ module Spear.GL
74, printGLError 74, printGLError
75, assertGL 75, assertGL
76 -- * OpenGL 76 -- * OpenGL
77, module Graphics.Rendering.OpenGL.Raw.Core31 77, module Graphics.Rendering.OpenGL.Raw.Core32
78, Ptr 78, Ptr
79, nullPtr 79, nullPtr
80) 80)
@@ -99,7 +99,7 @@ import Foreign.Marshal.Utils as Foreign (with)
99import Foreign.Marshal.Alloc (alloca) 99import Foreign.Marshal.Alloc (alloca)
100import Foreign.Marshal.Array (withArray) 100import Foreign.Marshal.Array (withArray)
101import Foreign.Storable (peek) 101import Foreign.Storable (peek)
102import Graphics.Rendering.OpenGL.Raw.Core31 102import Graphics.Rendering.OpenGL.Raw.Core32
103import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory) 103import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory)
104import System.IO (hPutStrLn, stderr) 104import System.IO (hPutStrLn, stderr)
105import Unsafe.Coerce 105import Unsafe.Coerce
@@ -127,11 +127,12 @@ instance ResourceClass GLSLProgram where
127 getResource = getProgramKey 127 getResource = getProgramKey
128 128
129-- | Supported shader types. 129-- | Supported shader types.
130data ShaderType = VertexShader | FragmentShader deriving (Eq, Show) 130data ShaderType = VertexShader | FragmentShader | GeometryShader deriving (Eq, Show)
131 131
132toGLShader :: ShaderType -> GLenum 132toGLShader :: ShaderType -> GLenum
133toGLShader VertexShader = gl_VERTEX_SHADER 133toGLShader VertexShader = gl_VERTEX_SHADER
134toGLShader FragmentShader = gl_FRAGMENT_SHADER 134toGLShader FragmentShader = gl_FRAGMENT_SHADER
135toGLShader GeometryShader = gl_GEOMETRY_SHADER
135 136
136-- | Apply the given function to the program's id. 137-- | Apply the given function to the program's id.
137withGLSLProgram :: GLSLProgram -> (GLuint -> a) -> a 138withGLSLProgram :: GLSLProgram -> (GLuint -> a) -> a