com.jogamp.gluegen.opengl
Class BuildStaticGLInfo

java.lang.Object
  extended by 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 .


Field Summary
protected static Pattern associationPattern
           
protected  boolean debug
           
protected  Map<String,String> declarationToExtensionMap
           
protected static int defineIdentifierGroup
           
protected static Pattern definePattern
           
protected  Map<String,Set<String>> extensionToDeclarationMap
           
protected static int funcIdentifierGroup
           
protected static Pattern funcPattern
           
 
Constructor Summary
BuildStaticGLInfo()
           
 
Method Summary
protected  void addAssociation(String identifier, String association)
           
 void dump()
           
 void emitJavaCode(PrintWriter output, String packageName)
           
 Set<String> getDeclarations(String extension)
           
 String getExtension(String identifier)
           
 Set<String> getExtensions()
           
static void main(String[] args)
          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
 void parse(String cHeaderFilePath)
          Parses the supplied C header file and adds the function associations contained therein to the internal map.
 void parse(String[] cHeaderFilePaths)
          Parses the supplied C header files and adds the function associations contained therein to the internal map.
 void setDebug(boolean v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

BuildStaticGLInfo

public BuildStaticGLInfo()
Method Detail

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.