Some OpenGL functions not available in Windows?

My app works great in Mac but isn’t working in Windows. At first, it wouldn’t compile until I added JUCE_OPENGL3=1 as a preprocessor macro but now it just crashes and what seems to be happening is that in OpenGlExtensionsFunctions, there are a couple functions not being made available which should be loaded dynamically (I guess?). These appear to be the JUCE_GL_VERTEXBUFFER_FUNCTIONS.

Here’s a shot from my code:

And I trace it back to where these functions are loaded.

It looks like since I added JUCE_OPENGL3=1, these functions should be available but they are not. I would super grateful for any help with this.

Are you using the OpenGLExtensionFunctions member provided by the active OpenGLContext or are you using your own declaration of the struct? In the latter case, you must call the initialise() function for the struct which performs the dynamic loading, as seen here:

1 Like

I was doing it as my own declaration. If I start with initialize(), I now get an exception thrown in the function initializeOnThread().

I tried it both ways, same error in the same place.

I would go with using the extension function struct included with the OpenGLContext, since it does the initialisation for you, in essence:

void renderOpenGL()
{
    OpenGLContext &gl = *OpenGLContext::getCurrentContext();
    gl.extensions.glGenBuffers(...);
}

Okay let me try that

Also bear in mind that the large majority of the OpenGL functions and macros are not wrangled within OpenGLExtensionFunctions. In fairness, there are a shit load of em but it’s totally feasible to do…

I made a feature request for that: FR: Wrangle a comprehensive set of OpenGL functions & macros

2 Likes

I replaced it my “gl” with that snippet everywhere but it still throws an exception on the initializeOnThread function.

Does that mean anything to you? In xCode, I can usually see more detail about what’s going on with the debugger than this so I apologize if I just am not seeing certain details.