Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Restrict OpenGL to core functionalities.

Hybrid View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Restrict OpenGL to core functionalities.

    I take a look at the forum but didn't finding anything about it. In the learning process of OpenGL many tutorials use OpenGL 2.1 (glBegin, glEnd, etc). Is there a way to restrict the available functions to only the core version and avoid the deprecated with some compiler error?

  2. #2
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,261

    Re: Restrict OpenGL to core functionalities.

    You create a core context. And in GLSL use "#version 330 core" . That's all.

    No compiler error will be generated, just a crash on calling a function that wglGetProcAddress naturally returned NULL for, or a glGetError() returning invalid_enum after using some existing deprecated functions.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,726

    Re: Restrict OpenGL to core functionalities.

    Well, you could include a header that only provides the core functions (and extensions). Most OpenGL Loading Libraries don't provide these, but some do. GL3w only offers core functions, and the Unofficial GL SDK offers both core and compatibility headers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •