|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neovisionaries.android.opengl.GLESFactory
public final class GLESFactory
The factory class to get an implementation of GLES
interface.
If Android API Level is 8 (Android 2.2) or higher, an
implementation for OpenGL ES 2.0 is returned by getInstance()
method. Otherwise, an implementation for
OpenGL ES 1.1 is returned. Note that if Android API Level
were less than 4 (Android 1.6), this factory class itself
would not be able to be loaded.
If you want to make getInstance()
return another
different GLES
implementation, call initializeInstance(String)
or set a class name to the
system property GLES_IMPL_CLASS_PROPERTY
. See
the description of getInstance()
for details.
Field Summary | |
---|---|
static String |
GLES_IMPL_CLASS_PROPERTY
The name of the system property to specify a class name of an implementation of GLES interface. |
static String |
GLES_IMPL_GLES11
The class name of the default implementation of GLES interface for OpenGL ES 1.1. |
static String |
GLES_IMPL_GLES20
The class name of the default implementation of GLES interface for OpenGL ES 2.0 in
Android 2.2 (API Level 8). |
static String |
GLES_IMPL_GLES20_9
The class name of the default implementation of GLES interface for OpenGL ES 2.0 in
Android 2.3 (API Level 9) and newer. |
Method Summary | |
---|---|
static GLES |
getInstance()
Get an implementation of GLES interface. |
static void |
initializeInstance(String className)
Initialize the singleton instance of GLES implemetation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String GLES_IMPL_CLASS_PROPERTY
GLES
interface.
public static final String GLES_IMPL_GLES20
GLES
interface for OpenGL ES 2.0 in
Android 2.2 (API Level 8).
public static final String GLES_IMPL_GLES20_9
GLES
interface for OpenGL ES 2.0 in
Android 2.3 (API Level 9) and newer.
public static final String GLES_IMPL_GLES11
GLES
interface for OpenGL ES 1.1.
Method Detail |
---|
public static void initializeInstance(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
GLES
implemetation.
You do not have to call this method if the default implementation
suits your needs. See the description of getInstance()
for the case you need to call this method.
className
- The name of a class that implements GLES
interface.
IllegalArgumentException
- The given argument is null.
IllegalStateException
- The singleton instance has aleady been created.
ClassNotFoundException
InstantiationException
IllegalAccessException
getInstance()
public static GLES getInstance()
GLES
interface.
If initializeInstance(String)
has been called before
this method is called, the object created in the call of
initializeInstance(String)
is returned. In other words,
to use another implementation of GLES
that is different
from the one selected by the steps described below, call initializeInstance(String)
before this method. Note that
because getInstance() method is called at various places in the
implementation of this Java package, if you want to use initializeInstance(String)
, you must call it before not only
calling getInstance() but also referring to any other class in
this Java package.
The steps to select an implementation of GLES
instance
are as follows.
GLES_IMPL_CLASS_PROPERTY
is checked. If it holds a non-null value, the value is
used as a class name of a GLES
implementation.
GLES_IMPL_GLES20_9
is used as a class name of a
GLES
implementation.
GLES_IMPL_GLES20
is used as a class name of a
GLES
implementation.
GLES_IMPL_GLES11
is used
as a class name of a GLES
implementation.
If you want to use OpenGL ES 1.1 instead of OpenGL ES 2.0 on
Android 2.2 (API Level 8) or newer, you need to call initializeInstance(String)
or set a class name to the
system property GLES_IMPL_CLASS_PROPERTY
.
The default GLES
implementation for OpenGL ES 2.0 is
different between Android 2.2 and Android 2.3 (and newer).
This is because
android.opengl.GLES20 class in Anroid 2.2 does not have
the method listed below although it should have.
GLES
interface.
UnsupportedOperationException
- Failed to create an object implementing GLES
interface.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |