Question

I have done some simple OpenGL (old fixed pipeline ,without shaders ..etc) and want to start some serious "modern" OpenGL programming. (Should compile on Windows and Linux)

I have few questions.

1) In Windows , the "gl.h" doesnt have OpenGL2.0+ related API calls declared .(eg. glShaderSource() ) . How can I access these API calls? I dont want to install graphics-card specific headers since, I want to compile this application in other machines.

2) In Linux ,If I install Mesa library can I access above OpenGL2+ APIs functions ?

Was it helpful?

Solution

There has been a long-held belief among some (due to the slowness of GL version updates in the late 90s/early 00s) that the way to get core OpenGL calls was to just include a header and a library. That loading function pointers manually was something you did for extensions, for "graphics-card specific" function. That isn't the case.

You should always use an extension loading library to get access to OpenGL functions, whether core or extension. GLEW is a pretty good one, and GL3W is decent if you can live with its limitations (3.0 core or better only).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top