PDA

View Full Version : OpenGL functions definitions



LaPriWa
11-09-2016, 12:01 PM
This is my first post. I'm curious about where to find the definitions of OpenGL functions, like glVertexAttribPointer(). I found the prototypes in some headerfiles, for example gl.h. The API reference and other sources yielded no answer to my question. Could anyone be so kind and provide me with the information about where those functions are defined?

Sincerely yours
LaPriWa

john_connor
11-09-2016, 12:14 PM
read the wiki:
https://www.opengl.org/wiki/Load_OpenGL_Functions
https://www.opengl.org/wiki/OpenGL_Loading_Library

the easiest way is to use a library, like "GLEW"
http://glew.sourceforge.net/


edit: --> sorry, i misunderstood the question ..
https://www.opengl.org/sdk/docs/man4/

Dark Photon
11-09-2016, 02:59 PM
I'm curious about where to find the definitions of OpenGL functions, like glVertexAttribPointer(). ... Could anyone be so kind and provide me with the information about where those functions are defined?

The authoritative source is the OpenGL Specification. Grab the latest version from here:

* http://www.opengl.org/registry

For instance:

* OpenGL 4.5 Compatibility Profile Specification (https://www.opengl.org/registry/doc/glspec45.compatibility.pdf)

When searching for functions and other symbols in these PDF specifications, remove the leading "gl". So for example, search for "VertexAttribPointer".

That said, you can often find GL manual pages for these functions online (just websearch the function) as well as entries for many of them in the OpenGL Wiki (https://www.opengl.org/wiki). For example, see:

* https://www.opengl.org/sdk/docs/man2/xhtml/glVertexPointer.xml
* https://www.opengl.org/wiki/GLAPI/glClear

Note that the OpenGL Wiki tends to avoid defining reference pages for functions that aren't part of the core profile, whereas the man pages don't have this limitation.

mhagain
11-09-2016, 03:05 PM
The functions actually exist in your OpenGL implementation, i.e. the device driver for your graphics card. In case you're wondering, you cannot view the actual source code for them, because OpenGL is not open source (the "open" means something entirely different) nor is it software.