com.jogamp.gluegen.opengl
Class BuildStaticGLInfo
java.lang.Object
com.jogamp.gluegen.opengl.BuildStaticGLInfo
public class BuildStaticGLInfo
- extends Object
Builds the StaticGLInfo class from the OpenGL header files (i.e., gl.h
and glext.h) whose paths were passed as arguments to main(String[])
.
It relies upon the assumption that a function's membership is scoped by
preprocessor blocks in the header files that match the following pattern:
#ifndef GL_XXXX
GLAPI glFuncName()
#endif GL_XXXX
For example, if it parses the following data:
#ifndef GL_VERSION_1_3
GLAPI void APIENTRY glActiveTexture (GLenum);
GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
GLAPI void glFuncName()
#endif GL_VERSION_1_3
#ifndef GL_ARB_texture_compression
GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
#endif
It will associate
glActiveTexture
and
glMultiTexCoord1dv
with the symbol
GL_VERSION_1_3
,
and associate
glCompressedTexImage2DARB
and
glCompressedTexImage3DARB
with the symbol
GL_ARB_texture_compression
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
funcIdentifierGroup
protected static int funcIdentifierGroup
funcPattern
protected static Pattern funcPattern
associationPattern
protected static Pattern associationPattern
defineIdentifierGroup
protected static int defineIdentifierGroup
definePattern
protected static Pattern definePattern
declarationToExtensionMap
protected Map<String,String> declarationToExtensionMap
extensionToDeclarationMap
protected Map<String,Set<String>> extensionToDeclarationMap
debug
protected boolean debug
BuildStaticGLInfo
public BuildStaticGLInfo()
main
public static void main(String[] args)
throws IOException
- The first argument is the package to which the StaticGLInfo class
belongs, the second is the path to the directory in which that package's
classes reside, and the remaining arguments are paths to the C header
files that should be parsed
- Throws:
IOException
setDebug
public void setDebug(boolean v)
parse
public void parse(String[] cHeaderFilePaths)
throws IOException
- Parses the supplied C header files and adds the function
associations contained therein to the internal map.
- Throws:
IOException
parse
public void parse(String cHeaderFilePath)
throws IOException
- Parses the supplied C header file and adds the function
associations contained therein to the internal map.
- Throws:
IOException
dump
public void dump()
getExtension
public String getExtension(String identifier)
getDeclarations
public Set<String> getDeclarations(String extension)
getExtensions
public Set<String> getExtensions()
emitJavaCode
public void emitJavaCode(PrintWriter output,
String packageName)
addAssociation
protected void addAssociation(String identifier,
String association)
Copyright 2010 JogAmp Community.