Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing OpenGL Core Profile Only

Tags:

opengl

Is there a compiler flag or another way of forcing OpenGL core profile only? I want to get an error when i use deprecated functions like glRotatef and so on.

EDIT1: I am using Linux, however, i am also interested in knowing how to do this in Windows

EDIT2: I would prefer to get an error at compile time, but runtime error would be ok as well.

like image 417
WesDec Avatar asked Jan 14 '11 16:01

WesDec


2 Answers

You could compile your code using gl3.h instead of gl.h.

http://www.opengl.org/registry/api/gl3.h

like image 171
rotoglup Avatar answered Sep 26 '22 18:09

rotoglup


Try wglCreateContextAttribsARB() with WGL_CONTEXT_CORE_PROFILE_BIT_ARB.

Or glXCreateContextAttribsARB with GLX_CONTEXT_CORE_PROFILE_BIT_ARB.

You might find this example useful as a testbed.

like image 38
genpfault Avatar answered Sep 26 '22 18:09

genpfault