1

I've had a problem after converting some C++ code to Haskell on Windows. The code in C++ works fine, but in Haskell any OpenGL function fails to load, i.e.

user error (unknown OpenGL extension entry glGenVertexArrays, check for
OpenGL 3.1)

Whereas the function works fine in C++ (where I'm using glLoadGen). I've loaded both into depends.exe and don't see any difference in what they use from OpenGL32.dll.

I'm using OpenGLRaw-1.3.0.0.

Dan
  • 12,409
  • 3
  • 50
  • 87
  • 1
    Any reason you are using `OpenGLRaw` instead of `OpenGL`? Can you run a simple example program at all, or is it just `glGenVertexArrays` which gives the error? – user2407038 Feb 17 '14 at 23:19
  • I am using OpenGl, but the version of that shouldn't matter. Any it's any non 1.1 function. – Dan Feb 18 '14 at 00:37

1 Answers1

2

This was caused by trying to call GL functions before calling Graphics.UI.GLFW.makeContextCurrent. There needs to be a current context before any GL functions are available.

Dan
  • 12,409
  • 3
  • 50
  • 87