FR: Wrangle a comprehensive set of OpenGL functions & macros

This FR requests adding a more comprehensive set of functions and macros to the existing lists in the GL wrapping logic.

A variety of loading libraries exist already (GLEW and GL3W spring to mind). The thing is, if JUCE wants to go into a path that works and looks nice with the framework, then it really should go the whole way - preferably with some tool that automatically generates the lists of funcs and macros.

Some example functions that should be included:

but OpenGL is being deprecated… so why bother adding features to a DOA spec?

What are you on about? No, it’s really not DOA by any stretch of the imagination! And it’s going to be around for another long while.

Apple did mention deprecating it, but that does not mean it’s suddenly vapourware for all platforms (you know, not Apple platforms).

Also, people won’t suddenly migrate to Vulkan, which many drivers and hardware don’t support. It’s also even more complex to wrap your head around and integrate.

OpenGL is mainstay for all systems for another long time.

7 Likes

+1 for this.
for my current project, I had to add these macros as they weren’t defined by JUCE:

// these definitions aren't a part of juce::MissingOpenGLDefinitions
#if JUCE_WINDOWS
#define GL_BGRA                     0x80E1
#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
#define GL_TEXTURE_MAX_LEVEL		0x813D
#endif

As a side note, it’s kind of strange that on macOS, you can do juce::OpenGLExtensionFunctions::glSomething, while on Windows you have to obtain an instance of OpenGLExtensionFunctions. I suggest making these functions non-static on macOS as well, so that devs like me who primarily code on macOS don’t get caught by surprise when their code that even uses OpenGLExtensionFunctions for supposed Windows compatibility breaks when switching to Windows.

3 Likes