|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.gfx.gl.GL
The interface to the native OpenGL library. Note: here we must be VERY careful, as this is one of the places where foreign code is not sandboxed automatically for us. All parameters that go to C level must be checked either here or at the C level, otherwise -- BOOM.
Nested Class Summary | |
static class |
GL.ByteVector
A vector of bytes stored in C++ space. |
static class |
GL.DisplayList
An OpenGL display list. |
static interface |
GL.EventHandler
An interface to which GL provides events. |
static class |
GL.Font
A (mosaic-tiled) OpenGL font. |
static class |
GL.Image
A buffer on the C++ side, containing a single image. |
static class |
GL.ImageCache
|
static class |
GL.JavaObject
The Java proxy for a C++ object. |
static class |
GL.NonRenderableJavaObject
A Java object which is not supposed to be placed on display lists. |
static class |
GL.Program
An OpenGL program object. |
static class |
GL.Renderable0JavaObject
The Java proxy representing a Renderable object. |
static class |
GL.Renderable1JavaObject
The Java proxy representing a Renderable object. |
static class |
GL.Renderable2JavaObject
The Java proxy representing a Renderable2 object. |
static class |
GL.Renderable3JavaObject
The Java proxy representing a Renderable2 object. |
static class |
GL.RenderingSurface
|
static class |
GL.ShaderRect
3D/2D shader image data, loaded into textures. |
static class |
GL.TexRect
A rectangular region of an image, loaded into a texture. |
static class |
GL.Texture
A texture object. |
static class |
GL.Window
An on-screen GLX window into which graphics can be drawn. |
Field Summary | |
static int |
CSFLAG_ACTIVE
Constants to bit-or with coordsys types. |
static int |
CSFLAGS
Constants to bit-or with coordsys types. |
static boolean |
dbg
|
static int |
RENDERABLE0
Constant for the int array to be passed to C++, or'ed together with the ID, indicating a zero-argument renderable. |
static int |
RENDERABLE1
See RENDERABLE0. |
static int |
RENDERABLE2
See RENDERABLE0. |
static int |
RENDERABLE3
See RENDERABLE0. |
static boolean |
workaroundStupidBuggyAtiDrivers
ATI drivers for the R300 family still have some serious bugs. |
Constructor Summary | |
GL()
|
Method Summary | |
static void |
addDeletable(GLDeletable d)
To be called from d.finalize(): set this object's deleteObject() to be called in GL thread. |
static int |
bitsPerTexel(java.lang.String format)
If known, return bits per texel of a given format. |
static void |
call(java.lang.String s)
CallGL the given string. |
static void |
call(java.lang.String s,
GL.Window w)
CallGL the given string in the given window. |
static GL.ByteVector |
createByteVector()
Create a new bytevector of size 0. |
static GL.ByteVector |
createByteVector(int size)
Create a new bytevector of the given size. |
static GL.DisplayList |
createDisplayList()
Create a new, empty display list. |
static GL.DisplayList |
createDisplayList(java.lang.String s)
Create a new display list and compile the given string using CallGL into it. |
static GL.Font |
createFont(java.lang.String name,
int loadPt)
Create a new font. |
static GL.Image |
createImage(java.lang.String filename)
Create a new image from the prescribed file. |
static GL.Program |
createProgram()
|
static GL.Program |
createProgram(java.lang.String program)
|
static GL.ShaderRect |
createShaderRect(java.lang.String turb,
java.lang.String col,
java.lang.String spots,
java.lang.String cell)
|
static GL.RenderingSurface |
createStableRenderingSurface(int w,
int h)
|
static GL.TexRect |
createTexRect(GL.Image img)
Create a new TexRect by loading the given image into a mosaic tile. |
static GL.Texture |
createTexture()
Create a new OpenGL texture object. |
static GL.Window |
createWindow(int x,
int y,
int w,
int h,
GL.EventHandler eh)
Create a new window. |
static void |
eventLoop(boolean wait)
Process native events. |
static void |
freeQueue()
Because objects have to be released by the same thread that obtained them, this method needs to be called every once in a while. |
static int[] |
getAllCSAt(int ninds,
int[] inds,
float[] pts,
int parent,
float x,
float y)
Get all the activated coordinate systems in whose unit squares the given point falls.. |
static int |
getDebugVar(java.lang.String name)
|
static java.lang.String[] |
getDebugVarNames()
|
static float[] |
getGLFloat(java.lang.String name)
Get float(s) describing the current OpenGL context. |
static float[] |
getGLProgram(java.lang.String target,
java.lang.String name)
Get the given program parameter. |
static int |
getGLProgrami(java.lang.String target,
int progId,
java.lang.String name)
|
static java.lang.String |
getGLString(java.lang.String name)
Get a string describing the current OpenGL context. |
static float[] |
getGLTexLevelParameterFloat(java.lang.String target,
int tex,
int level,
java.lang.String name)
Get float(s) describing the current state of the given level of the given OpenGL texture. |
static float[] |
getGLTexParameterFloat(java.lang.String target,
int tex,
java.lang.String name)
Get float(s) describing the current state of the given OpenGL texture. |
static java.lang.String |
getGLTokenString(int value)
Get the OpenGL token string corresponding to the given integer value. |
static boolean |
hasExtension(java.lang.String name)
Return a boolean showing whether the given extension is supported by the current OpenGL environment. |
static void |
init()
Init the library - to be called once during startup. |
static void |
interruptEventloop()
Interrupt the event loop. |
static void |
loadLib()
Load the OpenGL library. |
static void |
render(GL.RenderingSurface win,
int ninds,
int[] inds1,
float[] pts1,
int[] interpinds,
int[] inds2,
float[] pts2,
int[] codes,
float fract,
boolean standardcoords,
boolean showFinal)
|
static void |
setDebugVar(java.lang.String name,
int value)
|
static void |
startBackgroundImageLoader(java.lang.String uri)
|
static float |
timeRender(GL.RenderingSurface win,
int iters,
int ninds,
int[] inds1,
float[] pts1,
int[] codes,
boolean standardcoords)
|
static boolean |
transform(int ninds,
int[] inds,
float[] pts,
int coordsys,
boolean inverse,
float[] points,
float[] into)
|
static boolean |
transform2(int ninds,
int[] inds,
float[] pts,
int[] interpinds,
int[] inds2,
float[] pts2,
float fract,
boolean show1,
int coordsys,
boolean inverse,
float[] points,
float[] into)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean dbg
public static boolean workaroundStupidBuggyAtiDrivers
ATI: if you want to know what you're still doing wrong, just grep the source for this variable name ;)
A brief list of some of the issues:
public static final int CSFLAG_ACTIVE
public static final int CSFLAGS
public static final int RENDERABLE0
public static final int RENDERABLE1
public static final int RENDERABLE2
public static final int RENDERABLE3
Constructor Detail |
public GL()
Method Detail |
public static void loadLib()
public static void init()
public static void freeQueue()
public static void addDeletable(GLDeletable d)
public static GL.RenderingSurface createStableRenderingSurface(int w, int h)
public static GL.Window createWindow(int x, int y, int w, int h, GL.EventHandler eh)
public static GL.Image createImage(java.lang.String filename)
This method is VERY special: it is NOT necessary to have an OpenGL context for the thread it uses since it is guaranteed not to use OpenGL.
public static void startBackgroundImageLoader(java.lang.String uri)
public static GL.TexRect createTexRect(GL.Image img)
public static GL.Texture createTexture()
public static GL.Program createProgram()
public static GL.Program createProgram(java.lang.String program)
public static GL.ShaderRect createShaderRect(java.lang.String turb, java.lang.String col, java.lang.String spots, java.lang.String cell)
public static GL.Font createFont(java.lang.String name, int loadPt)
name
- Filename to load the font from.loadPt
- The pixel size to load the font at.public static GL.DisplayList createDisplayList()
public static GL.DisplayList createDisplayList(java.lang.String s)
public static GL.ByteVector createByteVector()
public static GL.ByteVector createByteVector(int size)
public static void call(java.lang.String s)
public static void call(java.lang.String s, GL.Window w)
public static void render(GL.RenderingSurface win, int ninds, int[] inds1, float[] pts1, int[] interpinds, int[] inds2, float[] pts2, int[] codes, float fract, boolean standardcoords, boolean showFinal)
public static float timeRender(GL.RenderingSurface win, int iters, int ninds, int[] inds1, float[] pts1, int[] codes, boolean standardcoords)
public static boolean transform(int ninds, int[] inds, float[] pts, int coordsys, boolean inverse, float[] points, float[] into)
public static boolean transform2(int ninds, int[] inds, float[] pts, int[] interpinds, int[] inds2, float[] pts2, float fract, boolean show1, int coordsys, boolean inverse, float[] points, float[] into)
public static int[] getAllCSAt(int ninds, int[] inds, float[] pts, int parent, float x, float y)
parent
- (currently ignored, may be used to restrict in future)public static void eventLoop(boolean wait)
wait
- If false, this function will return once there are no more
native events to process. If true, this function will wait
for the next native event.public static void interruptEventloop()
public static void setDebugVar(java.lang.String name, int value)
public static int getDebugVar(java.lang.String name)
public static java.lang.String[] getDebugVarNames()
public static java.lang.String getGLString(java.lang.String name)
name
- The parameter to query, e.g. "VENDOR", "VERSION"public static float[] getGLFloat(java.lang.String name)
name
- The parameter to query, e.g. "ALPHA_BITS"public static float[] getGLProgram(java.lang.String target, java.lang.String name)
target
- The name of the program target, e.g. "VERTEX_PROGRAM_ARB"name
- The name of the parameter to return, e.g. "MAX_PROGRAM_INSTRUCTIONS_ARB"public static int getGLProgrami(java.lang.String target, int progId, java.lang.String name)
public static float[] getGLTexParameterFloat(java.lang.String target, int tex, java.lang.String name)
target
- The texture target to bind the given
texture to for querying, e.g. "TEXTURE_2D"tex
- The OpenGL texture idname
- The parameter to query, e.g. "TEXTURE_RESIDENT"public static float[] getGLTexLevelParameterFloat(java.lang.String target, int tex, int level, java.lang.String name)
target
- The texture target to bind the given
texture to for querying, e.g. "TEXTURE_2D"tex
- The OpenGL texture idlevel
- The mipmap level to queryname
- The parameter to query, e.g. "TEXTURE_INTERNAL_FORMAT"public static boolean hasExtension(java.lang.String name)
public static java.lang.String getGLTokenString(int value)
GL.getGLTokenString( (int)(GL.getGLTexLevelParameterFloat( "TEXTURE_2D", id, 0, "TEXTURE_INTERNAL_FORMAT")[0] ) )yields the string representation for the internal format of the given texture id.
public static int bitsPerTexel(java.lang.String format)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |