How to create OpenGL function in class?

Hi, i’m gOzaru.
i am a new beginner in OpenGL programming.
i would like to make a class where it has OpenGL function, and i could call it when i want to use it.
but i don’t know how to create it.
Could any of u help me?
Thank u very much.

OpenGL functions are normal C functions, and they behave like any other C function. You can call them from anywhere, provided you include gl.h. You class can have a method, just like any other method, except that it calls OpenGL functions like glEnable() instead of strcmp(). Make sure that you have an OpenGL context (window) open and setup before you try to do OpenGL things.

PS : if you want to use high version of GL you will use GLEW or GLEE, but you should have bind a GL context to current thread.

If" Make sure that you have an OpenGL context (window) open and setup" sounds complex to you, use GLUT or GLFW.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.