Commits

Jason McKesson committed d57f35c

Fixes for bad programlisting.
Added page on extension files.

Comments (0)

Files changed (3)

Command Line Options.wiki

 
 With Lua on the path, the command-line should be specified as follows:
 
-{{{lua pathToLoadgen/LoadGen.lua <output filename> <options>}}}The {{{<output filename>}}} must be specified. The path provided is relative to the current directory. The base filename of the path (everything after the last directory separator) will be decorated as appropriate for generating the output files. You should not provide an extension; the system will provide those as needed. The generated files will append an appropriate prefix, depending on which specifications you are generating (OpenGL, WGL, or GLX), so you can provide the same base filename for all of these.
+{{{lua pathToLoadgen/LoadGen.lua <output filename> <options>}}}
+
+The {{{<output filename>}}} must be specified. The path provided is relative to the current directory. The base filename of the path (everything after the last directory separator) will be decorated as appropriate for generating the output files. You should not provide an extension; the system will provide those as needed. The generated files will append an appropriate prefix, depending on which specifications you are generating (OpenGL, WGL, or GLX), so you can provide the same base filename for all of these.
 
 The output filename should be specified before any of the options. You can specify it after the options or even between options, but if you specify it after the {{{-exts}}} option (but before any subsequent options), the system will mistake it for an extension name. Just specify it first to be safe.
 

Extension Files.wiki

+The extension file format is pretty simple, but it does have quite a bit of power to it.
+
+Every line of the file is expected to be one of the following:
+
+* Nothing. An empty line, spaces, anything that isn't visible text.
+* A {{{#include ""}}} statement. This will cause the loading of another extension file named in the {{{""}}}s. The //current file's location// will be the base directory for any relative paths. So if you do {{{#include "more.txt"}}}, it will search for {{{more.txt}}} in the same directory as this extension file.
+* A {{{#include <>}}} statement. This will cause the loading of another extension file named in the {{{<>}}}s. The location of the glLoadGen will be used for the base directory of any relative paths. This is mostly intended to allow easy inclusion of the standard extension files, located in the {{{extfiles}}} directory. Therefore, 
+* Anything starting with {{{//}}} will be ignored as a comment.
+* Anything starting with {{{--}}} will be ignored as a comment.
+* Any other text in a line will be interpreted as an extension name. Extension names should not have the "GL_"/"WGL_"/"GLX_" prefixes.
+The inclusion mechanism is quite powerful.
 
 To use the code generator, with Lua in your path (assuming that {{{lua}}} is the name of your Lua executable), type this:
 
-{{{lua LoadGen.lua -style=pointer_c -spec=gl -version=3.3 -profile=core core_3_3}}}This tells the system to generate a header/source pair for OpenGL ({{{-spec=gl}}}, as opposed to WGL or GLX), for version 3.3, the core profile. It will generate it in the {{{pointer_c}}} style, which means that it will use function pointer-style, with C linkage and source. Such code is usable from C and C++, or other languages that can interface with C.
+{{{lua LoadGen.lua -style=pointer_c -spec=gl -version=3.3 -profile=core core_3_3}}}
+
+This tells the system to generate a header/source pair for OpenGL ({{{-spec=gl}}}, as opposed to WGL or GLX), for version 3.3, the core profile. It will generate it in the {{{pointer_c}}} style, which means that it will use function pointer-style, with C linkage and source. Such code is usable from C and C++, or other languages that can interface with C.
 
 The option {{{core_3_3}}} is the basic component of the filename that will be used for the generation. Since it is generating OpenGL loaders (again, as opposed to WGL or GLX), it will generate files named {{{gl_core_3_3.*}}}, where * is the extension used by the particular style.
 
 
 Note that the above command line will //only// generate enumerators and functions for core OpenGL 3.3. It doesn't offer any extensions. To use extensions, you must ask for them with command line parameters, as follows:
 
-{{{lua LoadGen.lua -style=pointer_c -spec=gl -version=3.3 -profile=core core_3_3 -exts ARB_texture_view ARB_vertex_attrib_binding EXT_texture_filter_anisotropic -ext=EXT_texture_compression_s3tc -extfile=SomeFile.txt}}}The {{{-exts}}} option starts a list of space-separated extension names (note: don't try to put the output filename after {{{-exts}}}; the system can't tell the difference between a filename and an extension). The {{{-ext}}} option only specifies a single name.
+{{{lua LoadGen.lua -style=pointer_c -spec=gl -version=3.3 -profile=core core_3_3 -exts ARB_texture_view ARB_vertex_attrib_binding EXT_texture_filter_anisotropic -ext=EXT_texture_compression_s3tc -extfile=SomeFile.txt}}}
+
+The {{{-exts}}} option starts a list of space-separated extension names (note: don't try to put the output filename after {{{-exts}}}; the system can't tell the difference between a filename and an extension). The {{{-ext}}} option only specifies a single name.
 
 {{{-extfile}}} specifies a //filename// to load extensions from. The file is expected to contain extension names, one on each line. Extension files can also have {{{#include}}} directives, which will include another extension file (relative pathing only). Please don't infinitely recurse your inclusions; there's no protection in the system to check for it.