Skip to content

Commit 5be6d71

Browse files
committed
Fixes after new shaderSource interface.
1 parent aa8269f commit 5be6d71

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/Misc/SmoothOpenGL3.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ checked action getStatus getInfoLog message object = do
100100
compileAndCheck :: Shader -> IO ()
101101
compileAndCheck = checked compileShader compileStatus shaderInfoLog "compile"
102102

103-
compileShaderSource :: ShaderType -> [String] -> IO Shader
103+
compileShaderSource :: ShaderType -> String -> IO Shader
104104
compileShaderSource st source = do
105105
shader <- createShader st
106106
shaderSource shader $= source
@@ -119,8 +119,8 @@ createProgramUsing shaders = do
119119

120120
initShader :: IO (UniformLocation, AttribLocation, AttribLocation)
121121
initShader = do
122-
vertexShader <- compileShaderSource VertexShader [vertexShaderSource]
123-
fragmentShader <- compileShaderSource FragmentShader [fragmentShaderSource]
122+
vertexShader <- compileShaderSource VertexShader vertexShaderSource
123+
fragmentShader <- compileShaderSource FragmentShader fragmentShaderSource
124124
program <- createProgramUsing [vertexShader, fragmentShader]
125125
currentProgram $= Just program
126126

examples/OrangeBook/ogl2brick/Brick.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ readAndCompileShader :: ShaderType -> FilePath -> IO Shader
293293
readAndCompileShader st filePath = do
294294
src <- readFile filePath
295295
shader <- createShader st
296-
shaderSource shader $= [src]
296+
shaderSource shader $= src
297297
compileShader shader
298298
reportErrors
299299
ok <- get (compileStatus shader)

examples/RedBook8/common/LoadShaders.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
--------------------------------------------------------------------------------
1515

1616
module LoadShaders (
17-
ShaderSource(..), ShaderInfo(..), loadShaders
17+
ShaderSource'(..), ShaderInfo(..), loadShaders
1818
) where
1919

2020
import Control.Exception
@@ -25,22 +25,22 @@ import Graphics.Rendering.OpenGL
2525

2626
-- | The source of the shader source code.
2727

28-
data ShaderSource =
28+
data ShaderSource' =
2929
FileSource FilePath
3030
-- ^ The shader source code is located in the file at the given 'FilePath'.
3131
| StringSource String
3232
-- ^ The shader source code is directly given as a 'String'.
3333
deriving ( Eq, Ord, Show )
3434

35-
getSource :: ShaderSource -> IO String
35+
getSource :: ShaderSource' -> IO String
3636
getSource (FileSource path) = readFile path
3737
getSource (StringSource src) = return src
3838

3939
--------------------------------------------------------------------------------
4040

4141
-- | A description of a shader: The type of the shader plus its source code.
4242

43-
data ShaderInfo = ShaderInfo ShaderType ShaderSource
43+
data ShaderInfo = ShaderInfo ShaderType ShaderSource'
4444
deriving ( Eq, Ord, Show )
4545

4646
--------------------------------------------------------------------------------
@@ -63,7 +63,7 @@ loadCompileAttach _ [] = return ()
6363
loadCompileAttach program (ShaderInfo shType source : infos) =
6464
createShader shType `bracketOnError` deleteObjectName $ \shader -> do
6565
src <- getSource source
66-
shaderSource shader $= [src]
66+
shaderSource shader $= src
6767
compileAndCheck shader
6868
attachShader program shader
6969
loadCompileAttach program infos

0 commit comments

Comments
 (0)