Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
modify 2014-03-15-opengl-from-haskell.html
from http://funloop.org/post/2014-03-15-opengl-from-haskell.html
(root)$ diff src/glfw_after.hs src/glfw_before.hs
11c11
< import Graphics.GL
---
> import Graphics.Rendering.OpenGL.Raw
29,30d28
<
<
32,39c30,36
< [ GLFW.WindowHint'Samples 4 -- 4x antialiasing
< , GLFW.WindowHint'ContextVersionMajor 4 -- OpenGL 3.3
< , GLFW.WindowHint'ContextVersionMinor 1
< -- we don't want the old OpenGL
< ,GLFW.WindowHint'OpenGLProfile GLFW.OpenGLProfile'Core
< ,GLFW.WindowHint'OpenGLForwardCompat True
< ]
<
---
> [ GLFW.WindowHint'Samples 4 -- 4x antialiasing
> , GLFW.WindowHint'ContextVersionMajor 3 -- OpenGL 3.3
> , GLFW.WindowHint'ContextVersionMinor 3
> -- we don't want the old OpenGL
> , GLFW.WindowHint'OpenGLProfile GLFW.OpenGLProfile'Core
> ]
>
79c76
< glBindBuffer GL_ARRAY_BUFFER bufId
---
> glBindBuffer gl_ARRAY_BUFFER bufId
84c81
< GL_ARRAY_BUFFER
---
> gl_ARRAY_BUFFER
87c84
< GL_STATIC_DRAW
---
> gl_STATIC_DRAW
92c89
< glBindBuffer GL_ARRAY_BUFFER bufId
---
> glBindBuffer gl_ARRAY_BUFFER bufId
96c93
< GL_FLOAT -- coord type
---
> gl_FLOAT -- coord type
104,105c101,102
< [ (GL_VERTEX_SHADER, vertShader)
< , (GL_FRAGMENT_SHADER, fragShader)
---
> [ (gl_VERTEX_SHADER, vertShader)
> , (gl_FRAGMENT_SHADER, fragShader)
112c109
< GL_LINK_STATUS glGetProgramiv glGetProgramInfoLog progId
---
> gl_LINK_STATUS glGetProgramiv glGetProgramInfoLog progId
125c122
< GL_COMPILE_STATUS glGetShaderiv glGetShaderInfoLog shaderId
---
> gl_COMPILE_STATUS glGetShaderiv glGetShaderInfoLog shaderId
138c135
< logLength <- fetch GL_INFO_LOG_LENGTH
---
> logLength <- fetch gl_INFO_LOG_LENGTH
148c145
< [ "#version 410 core\n"
---
> [ "#version 330 core"
158c155
< [ "#version 410 core\n"
---
> [ "#version 330 core"
197,198c194,195
< glClear GL_COLOR_BUFFER_BIT
< glClear GL_DEPTH_BUFFER_BIT
---
> glClear gl_COLOR_BUFFER_BIT
> glClear gl_DEPTH_BUFFER_BIT
201c198
< glDrawArrays GL_TRIANGLES 0 3 -- for attrib array 0, draw 3 vertices
---
> glDrawArrays gl_TRIANGLES 0 3 -- for attrib array 0, draw 3 vertices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment