Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the interest of full disclosure, I wrote the following tool. I apologize if this reads like an advertisement.</p> <p>You can use the <a href="https://bitbucket.org/alfonse/glloadgen/wiki/Home" rel="noreferrer">OpenGL Loader Generator</a>. It's a tool that generates headers and source files for loading OpenGL functions. You specify which extensions and OpenGL versions you're interested in, and it only outputs the enums and functions for those versions. That's the primary feature of the tool: getting clean headers and source files that only contain the stuff you intend to use.</p> <p>But the secondary feature is that it has different styles of generation. These styles define the specifics of how the output is generated.</p> <p>The <a href="https://bitbucket.org/alfonse/glloadgen/wiki/Style_Pointer_C" rel="noreferrer">standard "pointer_c" style</a> generates code that looks a lot like GLEW, where the functions are <code>#define</code>s. That is actually <em>essential</em> in C, because you can't redefine globally accessible variables/function names. So you can't define a function pointer that has the same name as a non-pointer function. Such as <code>glVertex3f</code>; that name is already defined by the OpenGL library on some platforms, so you can't define a new version of it. You have to <code>#define</code> around it.</p> <p>C++ on the other hand has namespaces. So in <a href="https://bitbucket.org/alfonse/glloadgen/wiki/Style_Pointer_CPP" rel="noreferrer">the "pointer_cpp" style</a>, you get C++ headers and source that puts most of OpenGL in the <code>gl</code> namespace. This also means that the Pointer CPP style doesn't have to use #defines. So it doesn't. <code>gl::Vertex3f</code> is a function pointer with real argument types and names. Any decent code completion tool should be able to understand these.</p> <p><a href="https://bitbucket.org/alfonse/glloadgen/wiki/Style_No_Load_CPP" rel="noreferrer">The "noload_cpp" style</a> does the same thing. The difference is that there's no initialization function you have to call; you can call any function pointer and it will dynamically load that function if it hasn't been loaded already.</p> <p>Spurred by this discussion, I have released a version of the tool that includes <a href="https://bitbucket.org/alfonse/glloadgen/wiki/Style_Function_CPP" rel="noreferrer">the func_cpp style</a>. This uses inline functions to forward calls to the function pointers. This is directly using functions, so if it can't parse these, then there's no hope for your autocompletion tool.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload