Commits

Jason McKesson committed 61a64f9

Update from recent changes.

Comments (0)

Files changed (3)

New_Style_Step_By_Step.wiki

 # The function used to get the extensions string is a function which in many cases must be loaded.
 # OpenGL (but not WGL/GLX) changed how you get the list of available extensions in GL 3.0.
 
-That last problem is the most devious (we will solve #1 by just loading the function. If it's not there, we exit with a failure). Let's investigate further.
+That last problem is the most devious (we will solve #1 by just trying to load the function. If it's not there, we exit with a failure). Let's investigate further.
 
 In OpenGL 2.1 and below, you use {{{glGetString(GL_EXTENSIONS)}}} to get a space-separated list of extensions. This was fairly simple, but people kept screwing it up. So in GL 3.0, they added {{{glGetStringi}}}, which gets a string by an enum name and an index. So you use {{{glGetIntegerv(GL_NUM_EXTENSIONS)}}} to get the number of extensions, then iterate through that number, calling {{{glGetStringi(GL_EXTENSIONS, i)}}} for each.
 
 
 If we wanted, we could write the code to process things both ways, then pick which one to use based on what the actual context is. However, for the sake of simplicity, we won't be doing that. We will instead do what {{{pointer_c}}} and {{{pointer_cpp}}} do: they expect you to actually be serious about the version number. If you create an OpenGL 3.3 header, then you expect to be using OpenGL 3.3 or greater, and the loader is allowed to fail if that's not available.
 
-Therefore, if the user asks for OpenGL 3.0 or above, we will use the new-style functions; if the user asks for a lower version, we use the old style. Oh, and while we're doing this, remember that this code generator needs to work with WGL and GLX, which only use old-style. So we only use the new-style if we're writing OpenGL //and// version 3.0 or above is requested.
+Therefore, if the user asks for OpenGL 3.0 or above, we will use the new-style functions; if the user asks for a lower version, we use the old style. Oh, and while we're doing this, remember that this code generator needs to work with WGL and GLX, which //only// use old-style. So we only use the new-style if we're writing OpenGL //and// version 3.0 or above is requested.
 
 Is that complicated enough?
 

Structure_Reference.wiki

 * {{{key}}}: The string name of the new context variable. Required. Must end in the "{{{_}}}" character, to ensure that it doesn't conflict with other variables.
 * {{{data}}}: A Lua value that represents the new context variable's data.
 * {{{name}}}: The base name of the function to call to fill in the context variable. The full name will be prefixed by "{{{State}}}".
-* {{{dispose}}}: The base name of a function that takes the state (and //only// the context variable, so no parameter selection). This will be called when the variable is disposed of. This would be for clean-up work, like for file closing and such. The full name will be prefixed by "{{{Dispose}}}".
+* {{{dispose}}}: The base name of a function that takes the context variable (and //only// the context variable, so no parameter selection). This will be called when the variable is disposed of. This would be for clean-up work, like for file closing and such. The full name will be prefixed by "{{{Dispose}}}".
 
 Either {{{name}}} or {{{data}}} must be defined. {{{data}}} takes priority.
 
 
 ==Function Parameters==
 
-Here are a list of the various function parameters, with references to the actions that provide them.
+Here are a list of the various standard function parameters, with references to the actions that provide them.
 
 Again, //DO NOT MODIFY THEM!// You can call member functions on them and inspect them. But unless they're user-defined parameters, do not change their tables.
 

Style_Pointer_C.wiki

 
 For non-fail states, the value works like for the individual extension variables, except that the number that failed to load refer to core functions. So for specs that don't load core functions, it will always return {{{LOAD_SUCCEEDED}}}.
 
-Also, this style will generate functions to query the version of the OpenGL context.
+Also, this style will generate functions to query the version of the OpenGL context. They are:
+
+* {{{<prefix>ogl_GetMajorVersion()}}}: Returns an integer identifying the major version number of this OpenGL context.
+* {{{<prefix>ogl_GetMinorVersion()}}}: Returns an integer identifying the minor version number of this OpenGL context.
+* {{{<prefix>ogl_ogl_IsVersionGEQ(int majorVersion, int minorVersion)}}}: Returns non-zero if the current context version is larger than or equal to the given major and minor versions.
 
 ==Example==
 
-This example is for loading the OpenGL functions; it expects the OpenGL header to be included. For loading WGL/GLX functions, include their headers and change the "ogl"s to "wgl" or "glx" as appropriate.
+This example is for loading the OpenGL functions; it expects the OpenGL header generated by glLoadGen to be included. For loading WGL/GLX functions, include their headers and change the "ogl"s to "wgl" or "glx" as appropriate.
 
 {{{
 //Create OpenGL context and make it current.