Top Description Fields Constructors Methods
com.jogamp.opengl

public Class GLPipelineFactory

extends Object
Class Inheritance
Imports
java.lang.reflect.*, java.util.StringTokenizer, com.jogamp.common.util.ReflectionUtil, jogamp.opengl.*

Factory for pipelining GL instances

Field Summary

Modifier and TypeField and Description
public static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final GL
create(final String
the basename of the pipline class name
pipelineClazzBaseName
,
final Class<?>
optional requested interface to be used, may be null, in which case the first matching one is used
reqInterface
,
final GL
is always the 1st argument for the upstream constructor
downstream
,
final Object[]
additional arguments for the upstream constructor
additionalArgs
)

Creates a pipelined GL instance using the given downstream downstream and optional arguments additionalArgs for the constructor.

private static final String
getArgsClassNameList(final Class<?> arg0, final Object[] args)

private static final Class<?>
getUpstreamClazz(final Class<?> downstreamClazz, final String pipelineClazzBaseName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUGback to summary
public static final boolean DEBUG

Constructor Detail

GLPipelineFactoryback to summary
public GLPipelineFactory()

Method Detail

createback to summary
public static final GL create(final String pipelineClazzBaseName, final Class<?> reqInterface, final GL downstream, final Object[] additionalArgs)

Creates a pipelined GL instance using the given downstream downstream and optional arguments additionalArgs for the constructor.

Sample code which installs a Debug and Trace pipeline automatic w/ user defined interface, here: GL2ES2:

    gl = drawable.setGL( GLPipelineFactory.create("com.jogamp.opengl.Debug", GL2ES2.class, gl, null) );
    gl = drawable.setGL( GLPipelineFactory.create("com.jogamp.opengl.Trace", GL2ES2.class, gl, new Object[] { System.err } ) );
or automatic w/ automatic defined class:
    gl = drawable.setGL( GLPipelineFactory.create("com.jogamp.opengl.Debug",         null, gl, null) );
    gl = drawable.setGL( GLPipelineFactory.create("com.jogamp.opengl.Trace",         null, gl, new Object[] { System.err } ) );

The upstream GL instance is determined as follows:

  • Use pipelineClazzBaseName as the class name's full basename, incl. package name
  • For the downstream class and it's superclasses, do:
    • For all downstream class and superclass interfaces, do:
      • If reqInterface is not null and the interface is unequal, continue loop.
      • If downstream is not instance of interface, continue loop.
      • If upstream class is available use it, end loop.

Parameters
pipelineClazzBaseName:String

the basename of the pipline class name

reqInterface:Class<?>

optional requested interface to be used, may be null, in which case the first matching one is used

downstream:GL

is always the 1st argument for the upstream constructor

additionalArgs:Object[]

additional arguments for the upstream constructor

getArgsClassNameListback to summary
private static final String getArgsClassNameList(final Class<?> arg0, final Object[] args)
getUpstreamClazzback to summary
private static final Class<?> getUpstreamClazz(final Class<?> downstreamClazz, final String pipelineClazzBaseName)