JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.gluegen.opengl.BuildStaticGLInfo Class Reference

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[]). More...

Collaboration diagram for com.jogamp.gluegen.opengl.BuildStaticGLInfo:

Public Member Functions

void setDebug (final boolean v)
 
void parse (final String[] cHeaderFilePaths) throws IOException
 Parses the supplied C header files and adds the function associations contained therein to the internal map. More...
 
void parse (final String cHeaderFilePath) throws IOException
 Parses the supplied C header file and adds the function associations contained therein to the internal map. More...
 
void dump ()
 
Set< String > getExtension (final String identifier)
 
Set< String > getDeclarations (final String extension)
 
Set< String > getExtensions ()
 
void emitJavaCode (final PrintWriter output, final String packageName)
 

Static Public Member Functions

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. More...
 

Protected Member Functions

void addAssociation (final String identifier, final String association)
 

Protected Attributes

Map< String, Set< String > > declarationToExtensionMap = new HashMap<String, Set<String>>()
 
Map< String, Set< String > > extensionToDeclarationMap = new HashMap<String, Set<String>>()
 
boolean DEBUG = false
 

Static Protected Attributes

static final int funcIdentifierGroup = 9
 
static final Pattern funcPattern
 
static final Pattern associationPattern
 
static final Pattern ifPattern
 
static final Pattern elsePattern
 
static final Pattern endifPattern
 
static final int defineIdentifierGroup = 1
 
static final Pattern definePattern
 

Detailed Description

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 <returnType> <APIENTRY|GLAPIENTRY> glFuncName(<params>)
#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  <APIENTRY|GLAPIENTRY> glFuncName(<params>)
#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 .

Definition at line 106 of file BuildStaticGLInfo.java.

Member Function Documentation

◆ addAssociation()

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.addAssociation ( final String  identifier,
final String  association 
)
protected

Definition at line 384 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ dump()

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.dump ( )

Definition at line 266 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ emitJavaCode()

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.emitJavaCode ( final PrintWriter  output,
final String  packageName 
)

Definition at line 292 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ getDeclarations()

Set< String > com.jogamp.gluegen.opengl.BuildStaticGLInfo.getDeclarations ( final String  extension)

Definition at line 284 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ getExtension()

Set< String > com.jogamp.gluegen.opengl.BuildStaticGLInfo.getExtension ( final String  identifier)

Definition at line 280 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ getExtensions()

Set< String > com.jogamp.gluegen.opengl.BuildStaticGLInfo.getExtensions ( )

Definition at line 288 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

◆ main()

static void com.jogamp.gluegen.opengl.BuildStaticGLInfo.main ( final String[]  args) throws IOException
static

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.

Definition at line 141 of file BuildStaticGLInfo.java.

Here is the call graph for this function:

◆ parse() [1/2]

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.parse ( final String  cHeaderFilePath) throws IOException

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

Definition at line 200 of file BuildStaticGLInfo.java.

Here is the call graph for this function:

◆ parse() [2/2]

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.parse ( final String[]  cHeaderFilePaths) throws IOException

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

Definition at line 192 of file BuildStaticGLInfo.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDebug()

void com.jogamp.gluegen.opengl.BuildStaticGLInfo.setDebug ( final boolean  v)

Definition at line 186 of file BuildStaticGLInfo.java.

Here is the caller graph for this function:

Member Data Documentation

◆ associationPattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.associationPattern
staticprotected
Initial value:
=
Pattern.compile("\\#ifndef ([CEW]?GL[XU]?_[A-Za-z0-9_]+)(.*)")

Definition at line 113 of file BuildStaticGLInfo.java.

◆ DEBUG

boolean com.jogamp.gluegen.opengl.BuildStaticGLInfo.DEBUG = false
protected

Definition at line 133 of file BuildStaticGLInfo.java.

◆ declarationToExtensionMap

Map<String, Set<String> > com.jogamp.gluegen.opengl.BuildStaticGLInfo.declarationToExtensionMap = new HashMap<String, Set<String>>()
protected

Definition at line 128 of file BuildStaticGLInfo.java.

◆ defineIdentifierGroup

final int com.jogamp.gluegen.opengl.BuildStaticGLInfo.defineIdentifierGroup = 1
staticprotected

Definition at line 123 of file BuildStaticGLInfo.java.

◆ definePattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.definePattern
staticprotected
Initial value:
=
Pattern.compile("\\#define ([CEW]?GL[XU]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)(.*)")

Definition at line 124 of file BuildStaticGLInfo.java.

◆ elsePattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.elsePattern
staticprotected
Initial value:
=
Pattern.compile("\\#(elif|else)(.*)")

Definition at line 118 of file BuildStaticGLInfo.java.

◆ endifPattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.endifPattern
staticprotected
Initial value:
=
Pattern.compile("\\#endif(.*)")

Definition at line 120 of file BuildStaticGLInfo.java.

◆ extensionToDeclarationMap

Map<String, Set<String> > com.jogamp.gluegen.opengl.BuildStaticGLInfo.extensionToDeclarationMap = new HashMap<String, Set<String>>()
protected

Definition at line 132 of file BuildStaticGLInfo.java.

◆ funcIdentifierGroup

final int com.jogamp.gluegen.opengl.BuildStaticGLInfo.funcIdentifierGroup = 9
staticprotected

Definition at line 109 of file BuildStaticGLInfo.java.

◆ funcPattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.funcPattern
staticprotected
Initial value:
=
Pattern.compile("^(GLAPI|GL_API|GL_APICALL|EGLAPI|extern)?(\\s*)((unsigned|const)\\s+)?(\\w+)(\\s+\\*\\s*|\\s*\\*\\s+|\\s+)?(GLAPIENTRY|GL_APIENTRY|APIENTRY|EGLAPIENTRY|WINAPI)?(\\s*)([ew]?gl\\w+)\\s?(\\(.*)")

Definition at line 110 of file BuildStaticGLInfo.java.

◆ ifPattern

final Pattern com.jogamp.gluegen.opengl.BuildStaticGLInfo.ifPattern
staticprotected
Initial value:
=
Pattern.compile("\\#if(.*)")

Definition at line 116 of file BuildStaticGLInfo.java.


The documentation for this class was generated from the following file: