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 7 of 7

Thread: List of OpenGL functions per version

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2012
    Posts
    5

    Question List of OpenGL functions per version

    I am starting OpenGL and I face some problems:

    1. outdated examples written for early OpenGL versions
    2. outdated code that I probably need to update
    3. C-oriented everything

    I am completely lost in the specs, versions and notations that C coders use, so I'd like to start with the two questions:

    1. What is the primary (tested) source of OpenGL API for machines? PDF doesn't work, because it requires human to process.
    2. Is there already an official list of OpenGL functions per version?

    I need a simple plain list of functions in alphabetic order, maybe with parameters, so I can run a diff on them, compare and see which ones should be removed from my code to be OpenGL 4 or OpenGL 2 compliant.

  2. #2
    Intern Contributor
    Join Date
    Jul 2006
    Posts
    72
    The reference cards should suffice, like: http://www.khronos.org/files/opengl4...rence-card.pdf

    Although, OGL 2 and below are too ancient for anyone to care - the API specification is all you get.

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2012
    Posts
    5
    I guess you've seen that I explicitly mentioned that PDF won't work. Is everything so bad that only PDF is available? Parsing PDF is painful - it is made by humans who make mistakes. And it is very hard to track updates to this PDF (if possible at all).

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    This is sort of an odd-ball use, but you could use my glLoadGen tool to generate exactly that. It will generate headers/source for loaders for the specific OpenGL version you want. So you could simply copy-and-paste the header definitions out of them.

    it is made by humans who make mistakes.
    Yes. So are all of the other sources of OpenGL information.

    There are alternatives though. My glLoadGen tool is built on top of an XML-ized version (technically a "Lua-ized" version, but same difference) of the OpenGL .spec files, which are the canonical source of this information. Which was also written by humans who make mistakes. Parsing the .spec files directly is pretty difficult, though it shouldn't be too hard if you're looking for specific information.

    It would be easier to write an XSLT transform that looked for functions who's version tag was less than or equal to some number. Or, again, you could just use glLoadGen to make headers and copy them out to wherever you need them.

    Actually, you could use glLoadGen's parsing system to write your own generation style, who's sole purpose is to simply dump all of the function names for a version into a given file. It's a bit complex (and I haven't finished all the docs explaining everything about the process), but it's very doable.

  5. #5
    Junior Member Newbie
    Join Date
    Nov 2012
    Posts
    5
    Quote Originally Posted by Alfonse Reinheart View Post
    This is sort of an odd-ball use, but you could use my glLoadGen tool to generate exactly that. It will generate headers/source for loaders for the specific OpenGL version you want. So you could simply copy-and-paste the header definitions out of them.
    Thanks. The tool looks nice, but as I mentioned I don't do C. It is at least feasible to parse these headers/sources (unlike PDF), but still a lot of unreliable magic.

    Quote Originally Posted by Alfonse Reinheart View Post
    There are alternatives though. My glLoadGen tool is built on top of an XML-ized version (technically a "Lua-ized" version, but same difference) of the OpenGL .spec files, which are the canonical source of this information. Which was also written by humans who make mistakes. Parsing the .spec files directly is pretty difficult, though it shouldn't be too hard if you're looking for specific information.
    By "made by humans who make mistakes" I've meant that fixing a mistake in machine readable document will automatically propagate the fix to all derivatives. With PDF it is not possible.

    Those .spec files seem what I need. Why it is difficult to parse them? I don't know information structure, but http://www.opengl.org/registry/api/gl.spec looks like a set of key: value pairs.

    Quote Originally Posted by Alfonse Reinheart View Post
    Actually, you could use glLoadGen's parsing system to write your own generation style, who's sole purpose is to simply dump all of the function names for a version into a given file. It's a bit complex (and I haven't finished all the docs explaining everything about the process), but it's very doable.
    Are there any other known .spec tools (something in Python will be easier to hack)?
    I don't know the data structure - is it possible to use generic template engine for this generator? Like http://mustache.github.com/ ?

    For me it seems that the best place for structured data is public MongoDB at https://mongolab.com/home with public API to access it - https://support.mongolab.com/entries...pi-for-mongodb and a web browser.

  6. #6
    Intern Contributor nigels's Avatar
    Join Date
    Apr 2000
    Location
    Texas, USA
    Posts
    87
    Quote Originally Posted by techtonik View Post
    Are there any other known .spec tools (something in Python will be easier to hack)?

    There is a Python-based GL API description as part of https://github.com/p3/regal, as one other alternative.
    Specifically, https://github.com/p3/regal/blob/master/scripts/gl.py.


    - Nigel
    ---
    Regal - as OpenGL ought to be

  7. #7
    Junior Member Newbie
    Join Date
    Nov 2012
    Posts
    5
    Regal looks like one awesome piece of code. Is the information in `gl.py`generated automatically from gl.spec or it is manually maintained? I see that Export.py is the entrypoint into the output generation toolchain, but there is nothing about gl.spec parsing.

    regal is one step further from what I am trying to do. Very professional presentation and positioning.

    I try to create a simple OpenGL support diagnostic utility that will output information about the supported API and (maybe) give some recommendations how to improve it. When regal jumps directly into rendering, I want to detect known problems before they occur and warn about them.

Posting Permissions

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