Page 1 of 1

Replacing oglpfuncs with Khronos glcorearb.h for OpenGL function pointers in the pyramid sample

Posted: Thu Jan 07, 2021 8:28 pm
by leafblower
I have been playing around with the pyramid sample (based on a subset of the OpenGL 3.2 profile) for a while now, and was looking to move to instanced rendering.

To make draw calls to the GPU, the pyramid sample makes use of the 'glDrawArrays' function, which pointer is provided in the sample's oglpfuncs.h file.
The oglpfuncs header provides all the necessary pointers for the sample, but since it is designed to be a custom subset.

In order to achieve instanced rendering, you need the ''glDrawArraysInstanced' function, which isn't included in the sample.
To be able to continue to explore OpenGL, my idea was to use the "glcorearb.h" header provided by the Khronos registry for the complete set of pointers.
Now I've heard GLEW can be used for this end, but I like the way it's already done in the sample, and I just want to replace the "subset" of pointer definitions of oglpfuncs.h in the sample with glcorearb.h, since they are already a lot alike.
I know this will massively increase the compile-time with glcorearb.h being almost 6000 lines long, but I'm more interested in flexibility, and can create a final subset later on, when the set of function pointers I need has crystallized.

So, my question is: is this practical, or do I need to replace the oglpfuncs code altogether if I want the whole set? Do I need GLEW or is there a "right" way to do it in wxWidgets?