Top Description Fields Constructors Methods
com.jogamp.gluegen.opengl

public Class BuildStaticGLInfo

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .BufferedWriter, .File, .FileReader, .FileWriter, .IOException, .PrintWriter, java.util.ArrayList, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, java.util.regex.Matcher, .Pattern

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

Modifier and TypeField and Description
protected static final Pattern
protected boolean
protected Map<String, Set<String>>
protected static final int
protected static final Pattern
protected static final Pattern
protected static final Pattern
protected Map<String, Set<String>>
protected static final int
protected static final Pattern
protected static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addAssociation(final String identifier, final String association)

public void
dump()

public void
emitJavaCode(final PrintWriter output, final String packageName)

public Set<String>
getDeclarations(final String extension)

public Set<String>
getExtension(final String identifier)

public Set<String>
public static void
main(final 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

public void
parse(final String[] cHeaderFilePaths)

Parses the supplied C header files and adds the function associations contained therein to the internal map.

public void
parse(final String cHeaderFilePath)

Parses the supplied C header file and adds the function associations contained therein to the internal map.

public void
setDebug(final boolean v)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

associationPatternback to summary
protected static final Pattern associationPattern
DEBUGback to summary
protected boolean DEBUG
declarationToExtensionMapback to summary
protected Map<String, Set<String>> declarationToExtensionMap
defineIdentifierGroupback to summary
protected static final int defineIdentifierGroup
definePatternback to summary
protected static final Pattern definePattern
elsePatternback to summary
protected static final Pattern elsePattern
endifPatternback to summary
protected static final Pattern endifPattern
extensionToDeclarationMapback to summary
protected Map<String, Set<String>> extensionToDeclarationMap
funcIdentifierGroupback to summary
protected static final int funcIdentifierGroup
funcPatternback to summary
protected static final Pattern funcPattern
ifPatternback to summary
protected static final Pattern ifPattern

Constructor Detail

BuildStaticGLInfoback to summary
public BuildStaticGLInfo()

Method Detail

addAssociationback to summary
protected void addAssociation(final String identifier, final String association)
dumpback to summary
public void dump()
emitJavaCodeback to summary
public void emitJavaCode(final PrintWriter output, final String packageName)
getDeclarationsback to summary
public Set<String> getDeclarations(final String extension)
getExtensionback to summary
public Set<String> getExtension(final String identifier)
getExtensionsback to summary
public Set<String> getExtensions()
mainback to summary
public static void main(final 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

parseback to summary
public void parse(final String[] cHeaderFilePaths) throws IOException

Parses the supplied C header files and adds the function associations contained therein to the internal map.

parseback to summary
public void parse(final String cHeaderFilePath) throws IOException

Parses the supplied C header file and adds the function associations contained therein to the internal map.

setDebugback to summary
public void setDebug(final boolean v)