diff options
Diffstat (limited to 'Spear/GL.hs')
-rw-r--r-- | Spear/GL.hs | 7 |
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) | |||
99 | import Foreign.Marshal.Alloc (alloca) | 99 | import Foreign.Marshal.Alloc (alloca) |
100 | import Foreign.Marshal.Array (withArray) | 100 | import Foreign.Marshal.Array (withArray) |
101 | import Foreign.Storable (peek) | 101 | import Foreign.Storable (peek) |
102 | import Graphics.Rendering.OpenGL.Raw.Core31 | 102 | import Graphics.Rendering.OpenGL.Raw.Core32 |
103 | import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory) | 103 | import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory) |
104 | import System.IO (hPutStrLn, stderr) | 104 | import System.IO (hPutStrLn, stderr) |
105 | import Unsafe.Coerce | 105 | import 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. |
130 | data ShaderType = VertexShader | FragmentShader deriving (Eq, Show) | 130 | data ShaderType = VertexShader | FragmentShader | GeometryShader deriving (Eq, Show) |
131 | 131 | ||
132 | toGLShader :: ShaderType -> GLenum | 132 | toGLShader :: ShaderType -> GLenum |
133 | toGLShader VertexShader = gl_VERTEX_SHADER | 133 | toGLShader VertexShader = gl_VERTEX_SHADER |
134 | toGLShader FragmentShader = gl_FRAGMENT_SHADER | 134 | toGLShader FragmentShader = gl_FRAGMENT_SHADER |
135 | toGLShader 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. |
137 | withGLSLProgram :: GLSLProgram -> (GLuint -> a) -> a | 138 | withGLSLProgram :: GLSLProgram -> (GLuint -> a) -> a |