GL10Implpublic class GL10Impl extends Object implements GL10, GL10Ext
Fields Summary |
---|
static final boolean | debugQueue | static final boolean | DEBUG_MEM | static EGL10 | egl | EGLContext | contextcontext is the context the GL10
is created for. | int | pixelStorePackAlignment | int | pixelStoreUnpackAlignment | int | VERTEX_POINTER | int | COLOR_POINTER | int | NORMAL_POINTER | int | TEX_COORD_POINTER | int | POINT_SIZE_POINTER | int | MATRIX_INDEX_POINTER | int | WEIGHT_POINTER | Buffer[] | pointerBuffer | boolean[] | pointerEnabled | int[] | pointerSize | int[] | pointerType | int[] | pointerStride | int[] | pointerOffset | int[] | pointerRemaining | public static final int | CMD_ACTIVE_TEXTURE | public static final int | CMD_ALPHA_FUNC | public static final int | CMD_ALPHA_FUNCX | public static final int | CMD_BIND_BUFFER | public static final int | CMD_BIND_TEXTURE | public static final int | CMD_BLEND_FUNC | public static final int | CMD_BUFFER_DATA | public static final int | CMD_BUFFER_SUB_DATA | public static final int | CMD_CLEAR | public static final int | CMD_CLEAR_COLOR | public static final int | CMD_CLEAR_COLORX | public static final int | CMD_CLEAR_DEPTHF | public static final int | CMD_CLEAR_DEPTHX | public static final int | CMD_CLEAR_STENCIL | public static final int | CMD_CLIENT_ACTIVE_TEXTURE | public static final int | CMD_CLIP_PLANEF | public static final int | CMD_CLIP_PLANEFB | public static final int | CMD_CLIP_PLANEX | public static final int | CMD_CLIP_PLANEXB | public static final int | CMD_COLOR4F | public static final int | CMD_COLOR4X | public static final int | CMD_COLOR4UB | public static final int | CMD_COLOR_MASK | public static final int | CMD_COLOR_POINTER | public static final int | CMD_COLOR_POINTER_VBO | public static final int | CMD_COMPRESSED_TEX_IMAGE_2D | public static final int | CMD_COMPRESSED_TEX_SUB_IMAGE_2D | public static final int | CMD_COPY_TEX_IMAGE_2D | public static final int | CMD_COPY_TEX_SUB_IMAGE_2D | public static final int | CMD_CULL_FACE | public static final int | CMD_CURRENT_PALETTE_MATRIX | public static final int | CMD_DELETE_BUFFERS | public static final int | CMD_DELETE_BUFFERSB | public static final int | CMD_DELETE_TEXTURES | public static final int | CMD_DELETE_TEXTURESB | public static final int | CMD_DEPTH_FUNC | public static final int | CMD_DEPTH_MASK | public static final int | CMD_DEPTH_RANGEF | public static final int | CMD_DEPTH_RANGEX | public static final int | CMD_DISABLE | public static final int | CMD_DISABLE_CLIENT_STATE | public static final int | CMD_DRAW_ARRAYS | public static final int | CMD_DRAW_ELEMENTSB | public static final int | CMD_DRAW_ELEMENTS_VBO | public static final int | CMD_DRAW_TEXF | public static final int | CMD_DRAW_TEXFB | public static final int | CMD_DRAW_TEXI | public static final int | CMD_DRAW_TEXIB | public static final int | CMD_DRAW_TEXS | public static final int | CMD_DRAW_TEXSB | public static final int | CMD_DRAW_TEXX | public static final int | CMD_DRAW_TEXXB | public static final int | CMD_ENABLE | public static final int | CMD_ENABLE_CLIENT_STATE | public static final int | CMD_FOGF | public static final int | CMD_FOGFB | public static final int | CMD_FOGFV | public static final int | CMD_FOGX | public static final int | CMD_FOGXB | public static final int | CMD_FOGXV | public static final int | CMD_FRONT_FACE | public static final int | CMD_FRUSTUMF | public static final int | CMD_FRUSTUMX | public static final int | CMD_HINT | public static final int | CMD_LIGHTF | public static final int | CMD_LIGHTFB | public static final int | CMD_LIGHTFV | public static final int | CMD_LIGHTX | public static final int | CMD_LIGHTXB | public static final int | CMD_LIGHTXV | public static final int | CMD_LIGHT_MODELF | public static final int | CMD_LIGHT_MODELFB | public static final int | CMD_LIGHT_MODELFV | public static final int | CMD_LIGHT_MODELX | public static final int | CMD_LIGHT_MODELXB | public static final int | CMD_LIGHT_MODELXV | public static final int | CMD_LINE_WIDTH | public static final int | CMD_LINE_WIDTHX | public static final int | CMD_LOAD_IDENTITY | public static final int | CMD_LOAD_MATRIXF | public static final int | CMD_LOAD_MATRIXFB | public static final int | CMD_LOAD_MATRIXX | public static final int | CMD_LOAD_MATRIXXB | public static final int | CMD_LOAD_PALETTE_FROM_MODEL_VIEW_MATRIX | public static final int | CMD_LOGIC_OP | public static final int | CMD_MATERIALF | public static final int | CMD_MATERIALFB | public static final int | CMD_MATERIALFV | public static final int | CMD_MATERIALX | public static final int | CMD_MATERIALXB | public static final int | CMD_MATERIALXV | public static final int | CMD_MATRIX_INDEX_POINTER | public static final int | CMD_MATRIX_INDEX_POINTER_VBO | public static final int | CMD_MATRIX_MODE | public static final int | CMD_MULTI_TEXT_COORD4F | public static final int | CMD_MULTI_TEXT_COORD4X | public static final int | CMD_MULT_MATRIXF | public static final int | CMD_MULT_MATRIXFB | public static final int | CMD_MULT_MATRIXX | public static final int | CMD_MULT_MATRIXXB | public static final int | CMD_NORMAL3F | public static final int | CMD_NORMAL3X | public static final int | CMD_NORMAL_POINTER | public static final int | CMD_NORMAL_POINTER_VBO | public static final int | CMD_ORTHOF | public static final int | CMD_ORTHOX | public static final int | CMD_PIXEL_STOREI | public static final int | CMD_POINT_PARAMETERF | public static final int | CMD_POINT_PARAMETERFB | public static final int | CMD_POINT_PARAMETERFV | public static final int | CMD_POINT_PARAMETERX | public static final int | CMD_POINT_PARAMETERXB | public static final int | CMD_POINT_PARAMETERXV | public static final int | CMD_POINT_SIZE | public static final int | CMD_POINT_SIZEX | public static final int | CMD_POINT_SIZE_POINTER | public static final int | CMD_POINT_SIZE_POINTER_VBO | public static final int | CMD_POLYGON_OFFSET | public static final int | CMD_POLYGON_OFFSETX | public static final int | CMD_POP_MATRIX | public static final int | CMD_PUSH_MATRIX | public static final int | CMD_ROTATEF | public static final int | CMD_ROTATEX | public static final int | CMD_SAMPLE_COVERAGE | public static final int | CMD_SAMPLE_COVERAGEX | public static final int | CMD_SCALEF | public static final int | CMD_SCALEX | public static final int | CMD_SCISSOR | public static final int | CMD_SHADE_MODEL | public static final int | CMD_STENCIL_FUNC | public static final int | CMD_STENCIL_MASK | public static final int | CMD_STENCIL_OP | public static final int | CMD_TEX_COORD_POINTER | public static final int | CMD_TEX_COORD_POINTER_VBO | public static final int | CMD_TEX_ENVF | public static final int | CMD_TEX_ENVFB | public static final int | CMD_TEX_ENVFV | public static final int | CMD_TEX_ENVI | public static final int | CMD_TEX_ENVIB | public static final int | CMD_TEX_ENVIV | public static final int | CMD_TEX_ENVX | public static final int | CMD_TEX_ENVXB | public static final int | CMD_TEX_ENVXV | public static final int | CMD_TEX_IMAGE_2D | public static final int | CMD_TEX_PARAMETERF | public static final int | CMD_TEX_PARAMETERFB | public static final int | CMD_TEX_PARAMETERFV | public static final int | CMD_TEX_PARAMETERI | public static final int | CMD_TEX_PARAMETERIB | public static final int | CMD_TEX_PARAMETERIV | public static final int | CMD_TEX_PARAMETERX | public static final int | CMD_TEX_PARAMETERXB | public static final int | CMD_TEX_PARAMETERXV | public static final int | CMD_TEX_SUB_IMAGE_2D | public static final int | CMD_TRANSLATEF | public static final int | CMD_TRANSLATEX | public static final int | CMD_VERTEX_POINTER | public static final int | CMD_VERTEX_POINTER_VBO | public static final int | CMD_VIEWPORT | public static final int | CMD_WEIGHT_POINTER | public static final int | CMD_WEIGHT_POINTER_VBO | public static final int | CMD_FINISH | public static final int | CMD_FLUSH | public static final int | CMD_TEX_GENF | public static final int | CMD_TEX_GENI | public static final int | CMD_TEX_GENX | public static final int | CMD_TEX_GENFB | public static final int | CMD_TEX_GENIB | public static final int | CMD_TEX_GENXB | public static final int | CMD_TEX_GENFV | public static final int | CMD_TEX_GENIV | public static final int | CMD_TEX_GENXV | public static final int | CMD_BLEND_EQUATION | public static final int | CMD_BLEND_FUNC_SEPARATE | public static final int | CMD_BLEND_EQUATION_SEPARATE | public static final int | CMD_BIND_RENDERBUFFER | public static final int | CMD_DELETE_RENDERBUFFERS | public static final int | CMD_DELETE_RENDERBUFFERSB | public static final int | CMD_GEN_RENDERBUFFERSB | public static final int | CMD_RENDERBUFFER_STORAGE | public static final int | CMD_BIND_FRAMEBUFFER | public static final int | CMD_DELETE_FRAMEBUFFERS | public static final int | CMD_DELETE_FRAMEBUFFERSB | public static final int | CMD_GEN_FRAMEBUFFERSB | public static final int | CMD_FRAMEBUFFER_TEXTURE2D | public static final int | CMD_FRAMEBUFFER_RENDERBUFFER | public static final int | CMD_GENERATE_MIPMAP | public static final int | CMD_GEN_BUFFERSB | public static final int | CMD_GEN_TEXTURESB | static final String[] | commandStrings | int[] | queue | int | index | int | commandsLeft | public static EGLContext | currentContext | public static Hashtable | contextsByThreadIMPL_NOTE: contextsByThread may lead to the Java memory
leaks (when a thread dies, an associated context will not be ever
collected). As the possible workaround the following solution can be
used: a private Hashtable member can be added for class
Thread to keep a reference to the context. In this case
the life span of a context will not be longer then that of a thread. | public int | cullFaceMode | int | VBOArrayBufferBound | int | VBOElementArrayBufferBound | Hashtable | bufferSize | Hashtable | bufferIndices | Hashtable | VBOBuffersTable | Hashtable | VBOBufferSizeTable | Hashtable | VBOBufferIndicesTable |
Constructors Summary |
---|
public GL10Impl(EGLContext context)
this.context = context;
|
Methods Summary |
---|
void | IglClipPlanef(int plane, float[] equation, int offset)
q(CMD_CLIP_PLANEF, 5);
q(plane);
q(equation[offset]);
q(equation[offset + 1]);
q(equation[offset + 2]);
q(equation[offset + 3]);
| void | IglClipPlanex(int plane, int[] equation, int offset)
q(CMD_CLIP_PLANEX, 5);
q(plane);
q(equation[offset]);
q(equation[offset + 1]);
q(equation[offset + 2]);
q(equation[offset + 3]);
| void | IglDeleteTextures(int n, int[] textures, int offset)
q(CMD_DELETE_TEXTURES, n + 1);
q(n);
for (int i = 0; i < n; i++) {
q(textures[i + offset]);
}
| void | IglFogfv(int pname, float[] params, int offset)
int n = GLConfiguration.glFogNumParams(pname);
q(CMD_FOGFV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglFogxv(int pname, int[] params, int offset)
int n = GLConfiguration.glFogNumParams(pname);
q(CMD_FOGXV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglGenTextures(int n, int[] textures, int offset)
grabContext();
_glGenTextures(n, textures, offset);
| void | IglGetBooleanv(int pname, int[] params, int offset, int length)
grabContext();
_glGetBooleanv(pname, params, offset, length);
| void | IglGetIntegerv(int pname, int[] params, int offset, int length)
grabContext();
_glGetIntegerv(pname, params, offset, length);
| void | IglLightModelfv(int pname, float[] params, int offset)
int n = GLConfiguration.glLightModelNumParams(pname);
q(CMD_LIGHT_MODELFV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglLightModelxv(int pname, int[] params, int offset)
int n = GLConfiguration.glLightModelNumParams(pname);
q(CMD_LIGHT_MODELXV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglLightfv(int light, int pname, float[] params, int offset)
int n = GLConfiguration.glLightNumParams(pname);
q(CMD_LIGHTFV, n + 3);
q(n);
q(light);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglLightxv(int light, int pname, int[] params, int offset)
int n = GLConfiguration.glLightNumParams(pname);
q(CMD_LIGHTXV, n + 3);
q(n);
q(light);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglLoadMatrixf(float[] m, int offset)
q(CMD_LOAD_MATRIXF, 16);
for (int i = 0; i < 16; i++) {
q(m[i + offset]);
}
| void | IglLoadMatrixx(int[] m, int offset)
q(CMD_LOAD_MATRIXX, 16);
for (int i = 0; i < 16; i++) {
q(m[i + offset]);
}
| void | IglMaterialfv(int face, int pname, float[] params, int offset)
int n = GLConfiguration.glMaterialNumParams(pname);
q(CMD_MATERIALFV, n + 3);
q(n);
q(face);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglMaterialxv(int face, int pname, int[] params, int offset)
int n = GLConfiguration.glMaterialNumParams(pname);
q(CMD_MATERIALXV, n + 3);
q(n);
q(face);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglMultMatrixf(float[] m, int offset)
q(CMD_MULT_MATRIXF, 16);
for (int i = 0; i < 16; i++) {
q(m[i + offset]);
}
| void | IglMultMatrixx(int[] m, int offset)
q(CMD_MULT_MATRIXX, 16);
for (int i = 0; i < 16; i++) {
q(m[i + offset]);
}
| void | IglPointParameterfv(int pname, float[] params, int offset)
int n = GLConfiguration.glPointParameterNumParams(pname);
q(CMD_POINT_PARAMETERFV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglPointParameterxv(int pname, int[] params, int offset)
int n = GLConfiguration.glPointParameterNumParams(pname);
q(CMD_POINT_PARAMETERXV, n + 2);
q(n);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexEnvfv(int target, int pname, float[] params, int offset)
int n = GLConfiguration.glTexEnvNumParams(pname);
q(CMD_TEX_ENVFV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexEnviv(int target, int pname, int[] params, int offset)
int n = GLConfiguration.glTexEnvNumParams(pname);
q(CMD_TEX_ENVIV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexEnvxv(int target, int pname, int[] params, int offset)
int n = GLConfiguration.glTexEnvNumParams(pname);
q(CMD_TEX_ENVXV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexParameterfv(int target, int pname, float[] params, int offset)
int n = GLConfiguration.glTexParameterNumParams(pname);
q(CMD_TEX_PARAMETERFV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexParameteriv(int target, int pname, int[] params, int offset)
int n = GLConfiguration.glTexParameterNumParams(pname);
q(CMD_TEX_PARAMETERIV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| void | IglTexParameterxv(int target, int pname, int[] params, int offset)
int n = GLConfiguration.glTexParameterNumParams(pname);
q(CMD_TEX_PARAMETERXV, n + 3);
q(n);
q(target);
q(pname);
for (int i = 0; i < n; i++) {
q(params[i + offset]);
}
| native void | _execute(int[] queue, int count)
| static native int | _getNativeAddress(java.nio.Buffer buffer, int offset)
| native int | _glCheckFramebufferStatusOES(int target)
| native void | _glGenBuffers(int n, int[] buffers, int offset)
| native void | _glGenFramebuffersOES(int n, int[] framebuffers, int offset)
| native void | _glGenRenderbuffersOES(int n, int[] renderbuffers, int offset)
| native void | _glGenTextures(int n, int[] textures, int offset)
| native void | _glGenerateError(int error)
| native void | _glGetBooleanv(int pname, int[] params, int offset, int length)
| native void | _glGetBufferParameteriv(int target, int pname, int[] params, int offset, int length)
| native void | _glGetClipPlanef(int pname, float[] eqn, int offset)
| native void | _glGetClipPlanex(int pname, int[] eqn, int offset)
| native int | _glGetError()
| native void | _glGetFixedv(int pname, int[] params, int offset, int length)
| native void | _glGetFloatv(int pname, float[] params, int offset, int length)
| native void | _glGetFramebufferAttachmentParameterivOES(int target, int attachment, int pname, int[] params, int offset, int length)
| native void | _glGetIntegerv(int pname, int[] params, int offset, int length)
| native void | _glGetLightfv(int light, int pname, float[] params, int offset, int length)
| native void | _glGetLightxv(int light, int pname, int[] params, int offset, int length)
| native void | _glGetMaterialfv(int face, int pname, float[] params, int offset, int length)
| native void | _glGetMaterialxv(int face, int pname, int[] params, int offset, int length)
| native void | _glGetRenderbufferParameterivOES(int target, int pname, int[] params, int offset, int length)
| native java.lang.String | _glGetString(int name)
| native void | _glGetTexEnvfv(int env, int pname, float[] params, int offset, int length)
| native void | _glGetTexEnviv(int env, int pname, int[] params, int offset, int length)
| native void | _glGetTexEnvxv(int env, int pname, int[] params, int offset, int length)
| native int | _glGetTexGenfv(int coord, int pname, float[] params, int offset, int length)
| native int | _glGetTexGeniv(int coord, int pname, int[] params, int offset, int length)
| native int | _glGetTexGenxv(int coord, int pname, int[] params, int offset, int length)
| native void | _glGetTexParameterfv(int target, int pname, float[] params, int offset, int length)
| native void | _glGetTexParameteriv(int target, int pname, int[] params, int offset, int length)
| native void | _glGetTexParameterxv(int target, int pname, int[] params, int offset, int length)
| native int | _glIsBuffer(int buffer)
| native int | _glIsEnabled(int cap)
| native int | _glIsFramebufferOES(int framebuffer)
| native int | _glIsRenderbufferOES(int renderbuffer)
| native int | _glIsTexture(int texture)
| native int | _glQueryMatrixxOES(int[] mantissa, int mantissaOffset, int[] exponent, int exponentOffset)
| native void | _glReadPixelsByte(int x, int y, int width, int height, int format, int type, byte[] array, int offset)
| native void | _glReadPixelsInt(int x, int y, int width, int height, int format, int type, int[] array, int offset)
| native void | _glReadPixelsPtr(int x, int y, int width, int height, int format, int type, int pointer)
| void | addBuffer(int buffer)
// Adds an entry for a buffer, initially with size 0
if (DEBUG_MEM) {
System.out.println("addBuffer " + buffer);
}
if (buffer != 0) {
Integer key = new Integer(buffer);
VBOBuffersTable.put(key, new Object());
VBOBufferSizeTable.put(key, new Integer(0));
VBOBufferIndicesTable.put(key, new byte[0]);
}
| boolean | bufferExists(int buffer)
return (buffer == 0) ||
VBOBuffersTable.containsKey(new Integer(buffer));
| void | bufferIndexData(java.nio.Buffer data, int offset, int size, boolean removeOldData)
Integer key = new Integer(VBOElementArrayBufferBound);
byte[] array;
Object o = VBOBufferIndicesTable.get(key);
if (o == null || removeOldData) {
array = new byte[offset + size];
} else {
array = (byte[])o;
if (array.length < offset + size) {
byte[] narray = new byte[offset + size];
System.arraycopy(narray, 0, array, 0, offset + size);
array = narray;
}
}
// Copy bytes from 'data' into 'array'
BufferManager.getBytes(data, offset, array, offset, size);
// (Re-)store the index data
VBOBufferIndicesTable.put(key, array);
| int | bufferTypeSize(java.nio.Buffer pointer)
if (pointer instanceof ByteBuffer) {
return 1;
} else if (pointer instanceof ShortBuffer) {
return 2;
} else if (pointer instanceof IntBuffer ||
pointer instanceof FloatBuffer) {
return 4;
} else {
throw new IllegalArgumentException("Unknown Buffer subclass!");
}
| void | checkBounds(int last)
for (int ptr = VERTEX_POINTER; ptr <= WEIGHT_POINTER; ptr++) {
if (pointerEnabled[ptr]) {
final int remaining = (pointerBuffer[ptr] != null)
? pointerRemaining[ptr]
: getBufferSize(GL11.GL_ARRAY_BUFFER);
final int size = pointerSize[ptr];
final int type = pointerType[ptr];
final int offset = pointerOffset[ptr];
final int sizeOfType = GLConfiguration.sizeOfType(type);
final int stride = pointerStride[ptr] == 0 ? sizeOfType :
pointerStride[ptr];
final int elementSize = size * sizeOfType;
final int lastByte = offset + last * stride + elementSize;
if (lastByte > remaining) {
throw new ArrayIndexOutOfBoundsException(
String.valueOf(lastByte));
}
}
}
| void | checkDrawElementsBounds(byte[] indices)
| void | checkIndices(int[] indices)
int count = indices.length;
// System.out.println("checkIndices:");
// System.out.println(" indices = ");
// for (int i = 0; i < indices.length; i++) {
// System.out.print(indices[i] + " ");
// }
// System.out.println();
for (int ptr = VERTEX_POINTER; ptr <= WEIGHT_POINTER; ptr++) {
// System.out.println("ptr = " + ptr);
if (pointerEnabled[ptr]) {
int size, type, stride, offset, remaining;
if (pointerBuffer[ptr] != null) {
remaining = pointerRemaining[ptr];
} else {
remaining = getBufferSize(GL11.GL_ARRAY_BUFFER);
}
// System.out.println("remaining = " + remaining);
size = pointerSize[ptr];
type = pointerType[ptr];
stride = pointerStride[ptr];
offset = pointerOffset[ptr];
// System.out.println("size = " + size);
// System.out.println("type = " + type);
// System.out.println("stride = " + stride);
// System.out.println("offset = " + offset);
int elementSize = size*GLConfiguration.sizeOfType(type);
// System.out.println("elementSize = " + elementSize);
for (int i = 0; i < count; i++) {
int idx = indices[i];
int bidx =
offset + idx*(elementSize + stride) + elementSize;
// System.out.println("bidx[" + i + "] = " + bidx);
if (bidx > remaining) {
throw new ArrayIndexOutOfBoundsException("" +
bidx);
}
}
}
}
| void | checkLength(boolean[] params, int length, int offset)Utility for common error checking.
if (params == null) {
throwIAE(Errors.GL_PARAMS_NULL);
}
if (offset < 0) {
throwIAE(Errors.GL_OFFSET_NEGATIVE);
}
if (params.length - offset < length) {
throwIAE(Errors.GL_BAD_LENGTH);
}
| void | checkLength(short[] params, int length, int offset)Utility for common error checking.
if (params == null) {
throwIAE(Errors.GL_PARAMS_NULL);
}
if (offset < 0) {
throwIAE(Errors.GL_OFFSET_NEGATIVE);
}
if (params.length - offset < length) {
throwIAE(Errors.GL_BAD_LENGTH);
}
| void | checkLength(int[] params, int length, int offset)Utility for common error checking.
if (params == null) {
throwIAE(Errors.GL_PARAMS_NULL);
}
if (offset < 0) {
throwIAE(Errors.GL_OFFSET_NEGATIVE);
}
if (params.length - offset < length) {
throwIAE(Errors.GL_BAD_LENGTH);
}
| void | checkLength(float[] params, int length, int offset)Utility for common error checking.
if (params == null) {
throwIAE(Errors.GL_PARAMS_NULL);
}
if (offset < 0) {
throwIAE(Errors.GL_OFFSET_NEGATIVE);
}
if (params.length - offset < length) {
throwIAE(Errors.GL_BAD_LENGTH);
}
| void | checkLength(java.nio.Buffer params, int length)Utility for common error checking.
if (params == null) {
throwIAE(Errors.GL_PARAMS_NULL);
}
if (params.remaining() < length) {
throwIAE(Errors.GL_BAD_LENGTH);
}
| void | checkThread()
Thread boundThread = ((ContextAccess)context).getBoundThread();
if (Thread.currentThread() != boundThread) {
throw new IllegalStateException("GL call from improper thread");
}
| java.nio.Buffer | createDirectCopy(java.nio.Buffer data)
int length = data.remaining();
ByteBuffer direct;
if (data instanceof ByteBuffer) {
direct = ByteBuffer.allocateDirect(length);
direct.put((ByteBuffer)data);
return direct;
} else if (data instanceof ShortBuffer) {
direct = ByteBuffer.allocateDirect(2*length);
ShortBuffer directShort = direct.asShortBuffer();
directShort.put((ShortBuffer)data);
return directShort;
} else if (data instanceof IntBuffer) {
direct = ByteBuffer.allocateDirect(4*length);
IntBuffer directInt = direct.asIntBuffer();
directInt.put((IntBuffer)data);
return directInt;
} else if (data instanceof FloatBuffer) {
direct = ByteBuffer.allocateDirect(4*length);
FloatBuffer directFloat = direct.asFloatBuffer();
directFloat.put((FloatBuffer)data);
return directFloat;
} else {
throw new IllegalArgumentException(Errors.GL_UNKNOWN_BUFFER);
}
| public synchronized void | dispose()
glFinish();
this.context = null;
| int | floatToIntBits(float f)
int i = Float.floatToIntBits(f);
if (GLConfiguration.SWAP_FLOAT_BYTES) {
// Start: AABBCCDD
// End: DDCCBBAA
i = (((i << 24) & 0xff000000) |
((i << 8) & 0x00ff0000) |
((i >> 8) & 0x0000ff00) |
((i >> 24) & 0x000000ff));
}
return i;
| byte[] | getBufferIndices()
Integer key = key(GL11.GL_ELEMENT_ARRAY_BUFFER);
Object o = VBOBufferIndicesTable.get(key);
if (o != null) {
return (byte[])o;
} else {
throw new IllegalStateException("No VBO active for target!");
}
| int | getBufferSize(int target)
Integer key = key(target);
Object o = VBOBufferSizeTable.get(key);
if (o != null) {
return ((Integer)o).intValue();
} else {
throw new IllegalStateException("No VBO active for target!");
}
| public synchronized void | glActiveTexture(int texture)
checkThread();
q(CMD_ACTIVE_TEXTURE, 1);
q(texture);
| public synchronized void | glAlphaFunc(int func, float ref)
checkThread();
q(CMD_ALPHA_FUNC, 2);
q(func);
q(ref);
| public synchronized void | glAlphaFuncx(int func, int ref)
checkThread();
q(CMD_ALPHA_FUNCX, 2);
q(func);
q(ref);
| public synchronized void | glBindTexture(int target, int texture)
checkThread();
q(CMD_BIND_TEXTURE, 2);
q(target);
q(texture);
| public synchronized void | glBlendFunc(int sfactor, int dfactor)
checkThread();
q(CMD_BLEND_FUNC, 2);
q(sfactor);
q(dfactor);
| public synchronized void | glClear(int mask)
checkThread();
q(CMD_CLEAR, 1);
q(mask);
| public synchronized void | glClearColor(float red, float green, float blue, float alpha)
checkThread();
q(CMD_CLEAR_COLOR, 4);
q(red);
q(green);
q(blue);
q(alpha);
| public synchronized void | glClearColorx(int red, int green, int blue, int alpha)
checkThread();
q(CMD_CLEAR_COLORX, 4);
q(red);
q(green);
q(blue);
q(alpha);
| public synchronized void | glClearDepthf(float depth)
checkThread();
q(CMD_CLEAR_DEPTHF, 1);
q(depth);
| public synchronized void | glClearDepthx(int depth)
checkThread();
q(CMD_CLEAR_DEPTHX, 1);
q(depth);
| public synchronized void | glClearStencil(int s)
checkThread();
q(CMD_CLEAR_STENCIL, 1);
q(s);
| public synchronized void | glClientActiveTexture(int texture)
checkThread();
q(CMD_CLIENT_ACTIVE_TEXTURE, 1);
q(texture);
| public synchronized void | glColor4f(float red, float green, float blue, float alpha)
checkThread();
q(CMD_COLOR4F, 4);
q(red);
q(green);
q(blue);
q(alpha);
| public synchronized void | glColor4ub(byte red, byte green, byte blue, byte alpha)
checkThread();
q(CMD_COLOR4UB, 4);
q((int)red);
q((int)green);
q((int)blue);
q((int)alpha);
| public synchronized void | glColor4x(int red, int green, int blue, int alpha)
checkThread();
q(CMD_COLOR4X, 4);
q(red);
q(green);
q(blue);
q(alpha);
| public synchronized void | glColorMask(boolean red, boolean green, boolean blue, boolean alpha)
checkThread();
q(CMD_COLOR_MASK, 4);
q(red ? 1 : 0);
q(green ? 1 : 0);
q(blue ? 1 : 0);
q(alpha ? 1 : 0);
| public synchronized void | glColorPointer(int size, int type, int stride, java.nio.Buffer pointer)
checkThread();
if (VBOArrayBufferBound != 0) {
throw new IllegalStateException("glColorPointer:" +
Errors.VBO_ARRAY_BUFFER_BOUND);
}
if (pointer == null) {
throwIAE(Errors.GL_POINTER_NULL);
}
if (!isDirect(pointer)) {
throwIAE(Errors.GL_NOT_DIRECT);
}
// Only record details if this is a legal operation
if ((size == 4) &&
(type == GL_UNSIGNED_BYTE ||
type == GL_FIXED ||
type == GL_FLOAT) &&
(stride >= 0)) {
BufferManager.releaseBuffer(pointerBuffer[COLOR_POINTER]);
BufferManager.useBuffer(pointer);
pointerBuffer[COLOR_POINTER] = pointer;
pointerSize[COLOR_POINTER] = size;
pointerType[COLOR_POINTER] = type;
pointerStride[COLOR_POINTER] = stride;
int nbytes = bufferTypeSize(pointer);
pointerRemaining[COLOR_POINTER] = pointer.remaining()*nbytes;
pointerOffset[COLOR_POINTER] = 0;
}
q(CMD_COLOR_POINTER, 4);
q(size);
q(type);
q(stride);
q(pointer);
qflush();
| public synchronized void | glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, java.nio.Buffer data)
checkThread();
checkLength(data, imageSize);
boolean isReadOnly = false;
if (!isDirect(data)) {
data = createDirectCopy(data);
isReadOnly = true;
}
// Need revisit: BufferManager stuff
q(CMD_COMPRESSED_TEX_IMAGE_2D, 8);
q(target);
q(level);
q(internalformat);
q(width);
q(height);
q(border);
q(imageSize);
q(data);
if (!isReadOnly) {
qflush();
}
| public synchronized void | glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, java.nio.Buffer data)
checkThread();
checkLength(data, imageSize);
boolean isReadOnly = false;
if (!isDirect(data)) {
data = createDirectCopy(data);
isReadOnly = true;
}
// Need revisit: BufferManager stuff
q(CMD_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
q(target);
q(level);
q(xoffset);
q(yoffset);
q(width);
q(height);
q(format);
q(imageSize);
q(data);
if (!isReadOnly) {
qflush();
}
| public synchronized void | glCopyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border)
checkThread();
q(CMD_COPY_TEX_IMAGE_2D, 8);
q(target);
q(level);
q(internalformat);
q(x);
q(y);
q(width);
q(height);
q(border);
| public synchronized void | glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
checkThread();
q(CMD_COPY_TEX_SUB_IMAGE_2D, 8);
q(target);
q(level);
q(xoffset);
q(yoffset);
q(x);
q(y);
q(width);
q(height);
| public synchronized void | glCullFace(int mode)
checkThread();
q(CMD_CULL_FACE, 1);
q(mode);
// Workaround for Gerbera bug, CR 6401385
cullFaceMode = mode;
| public synchronized void | glDeleteTextures(int n, int[] textures, int offset)
checkThread();
checkLength(textures, n, offset);
IglDeleteTextures(n, textures, offset);
| public synchronized void | glDeleteTextures(int n, java.nio.IntBuffer textures)
checkThread();
// Need revisit: defend against race condition
checkLength(textures, n);
if (!textures.isDirect()) {
IglDeleteTextures(n, textures.array(), offset(textures));
return;
}
// Queue pointer
q(CMD_DELETE_TEXTURESB, 2);
q(n);
q(textures);
qflush();
| public synchronized void | glDepthFunc(int func)
checkThread();
q(CMD_DEPTH_FUNC, 1);
q(func);
| public synchronized void | glDepthMask(boolean flag)
checkThread();
q(CMD_DEPTH_MASK, 1);
q(flag ? 1 : 0);
| public synchronized void | glDepthRangef(float zNear, float zFar)
checkThread();
q(CMD_DEPTH_RANGEF, 2);
q(zNear);
q(zFar);
| public synchronized void | glDepthRangex(int zNear, int zFar)
checkThread();
q(CMD_DEPTH_RANGEX, 2);
q(zNear);
q(zFar);
| public synchronized void | glDisable(int cap)
checkThread();
q(CMD_DISABLE, 1);
q(cap);
| public synchronized void | glDisableClientState(int array)
checkThread();
switch (array) {
case GL_VERTEX_ARRAY:
pointerEnabled[VERTEX_POINTER] = false;
break;
case GL_COLOR_ARRAY:
pointerEnabled[COLOR_POINTER] = false;
break;
case GL_NORMAL_ARRAY:
pointerEnabled[NORMAL_POINTER] = false;
break;
case GL_TEXTURE_COORD_ARRAY:
pointerEnabled[TEX_COORD_POINTER] = false;
break;
case GL11.GL_POINT_SIZE_ARRAY_OES:
pointerEnabled[POINT_SIZE_POINTER] = false;
break;
case GL11Ext.GL_MATRIX_INDEX_ARRAY_OES:
pointerEnabled[MATRIX_INDEX_POINTER] = false;
break;
case GL11Ext.GL_WEIGHT_ARRAY_OES:
pointerEnabled[WEIGHT_POINTER] = false;
break;
}
q(CMD_DISABLE_CLIENT_STATE, 1);
q(array);
| public synchronized void | glDrawArrays(int mode, int first, int count)
checkThread();
checkBounds(first + count - 1);
q(CMD_DRAW_ARRAYS, 3);
q(mode);
q(first);
q(count);
| public synchronized void | glDrawElements(int mode, int count, int type, java.nio.Buffer indices)
checkThread();
if (VBOElementArrayBufferBound != 0) {
throw new IllegalStateException("glDrawElements:" +
Errors.VBO_ELEMENT_ARRAY_BUFFER_BOUND);
}
if (indices == null) {
throwIAE(Errors.GL_INDICES_NULL);
}
boolean isReadOnly = false;
if (!isDirect(indices)) {
indices = createDirectCopy(indices);
isReadOnly = true;
}
// No need to bounds check if there will be a type error
if (type == GL_UNSIGNED_BYTE ||
type == GL_UNSIGNED_SHORT) {
int nbytes = (type == GL_UNSIGNED_BYTE) ? 1 : 2;
if (count > indices.remaining()) {
throw new ArrayIndexOutOfBoundsException(
Errors.VBO_OFFSET_OOB);
}
if (DEBUG_MEM) {
System.out.print("glDrawElements: Allocating bufferData " +
count*nbytes);
}
byte[] bufferData = new byte[count*nbytes];
BufferManager.getBytes(indices, 0, bufferData, 0, count*nbytes);
if (DEBUG_MEM) {
System.out.println(": done");
System.out.print("glDrawElements: Allocating indexArray " +
count);
}
int[] indexArray = new int[count];
boolean isBigEndian = GLConfiguration.IS_BIG_ENDIAN;
if (DEBUG_MEM) {
System.out.println(": done");
}
if (type == GL_UNSIGNED_BYTE) {
for (int i = 0; i < count; i++) {
indexArray[i] = bufferData[i] & 0xff;
}
} else if (type == GL_UNSIGNED_SHORT) {
for (int i = 0; i < count; i++) {
int b0 = bufferData[2*i] & 0xff;
int b1 = bufferData[2*i + 1] & 0xff;
if (isBigEndian) {
indexArray[i] = (b0 << 8) | b1;
} else {
indexArray[i] = (b1 << 8) | b0;
}
}
}
checkIndices(indexArray);
}
q(CMD_DRAW_ELEMENTSB, 4);
q(mode);
q(count);
q(type);
q(indices);
if (!isReadOnly) {
qflush();
}
| public synchronized void | glEnable(int cap)
checkThread();
q(CMD_ENABLE, 1);
q(cap);
| public synchronized void | glEnableClientState(int array)
checkThread();
switch (array) {
case GL_VERTEX_ARRAY:
pointerEnabled[VERTEX_POINTER] = true;
break;
case GL_COLOR_ARRAY:
pointerEnabled[COLOR_POINTER] = true;
break;
case GL_NORMAL_ARRAY:
pointerEnabled[NORMAL_POINTER] = true;
break;
case GL_TEXTURE_COORD_ARRAY:
pointerEnabled[TEX_COORD_POINTER] = true;
break;
case GL11.GL_POINT_SIZE_ARRAY_OES:
pointerEnabled[POINT_SIZE_POINTER] = true;
break;
case GL11Ext.GL_MATRIX_INDEX_ARRAY_OES:
pointerEnabled[MATRIX_INDEX_POINTER] = true;
break;
case GL11Ext.GL_WEIGHT_ARRAY_OES:
pointerEnabled[WEIGHT_POINTER] = true;
break;
}
q(CMD_ENABLE_CLIENT_STATE, 1);
q(array);
| public synchronized void | glFinish()
checkThread();
q(CMD_FINISH, 0);
qflush();
| public synchronized void | glFlush()
checkThread();
q(CMD_FLUSH, 0);
qflush();
| public synchronized void | glFogf(int pname, float param)
checkThread();
q(CMD_FOGF, 2);
q(pname);
q(param);
| public synchronized void | glFogfv(int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glFogNumParams(pname);
checkLength(params, length, offset);
IglFogfv(pname, params, offset);
| public synchronized void | glFogfv(int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glFogNumParams(pname);
checkLength(params, length);
if (!isDirect(params)) {
IglFogfv(pname, params.array(), offset(params));
return;
}
q(CMD_FOGFB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glFogx(int pname, int param)
checkThread();
q(CMD_FOGX, 2);
q(pname);
q(param);
| public synchronized void | glFogxv(int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glFogNumParams(pname);
checkLength(params, length, offset);
IglFogxv(pname, params, offset);
| public synchronized void | glFogxv(int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glFogNumParams(pname);
checkLength(params, length);
if (!isDirect(params)) {
IglFogxv(pname, params.array(), offset(params));
return;
}
q(CMD_FOGXB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glFrontFace(int mode)
checkThread();
q(CMD_FRONT_FACE, 1);
q(mode);
| public synchronized void | glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar)
checkThread();
q(CMD_FRUSTUMF, 6);
q(left);
q(right);
q(bottom);
q(top);
q(zNear);
q(zFar);
| public synchronized void | glFrustumx(int left, int right, int bottom, int top, int zNear, int zFar)
checkThread();
q(CMD_FRUSTUMX, 6);
q(left);
q(right);
q(bottom);
q(top);
q(zNear);
q(zFar);
| public synchronized void | glGenTextures(int n, int[] textures, int offset)
checkThread();
checkLength(textures, n, offset);
qflush();
IglGenTextures(n, textures, offset);
| public synchronized void | glGenTextures(int n, java.nio.IntBuffer textures)
checkThread();
checkLength(textures, n);
qflush();
if (!isDirect(textures)) {
IglGenTextures(n, textures.array(), offset(textures));
return;
}
q(CMD_GEN_TEXTURESB, 2);
q(n);
q(textures);
qflush();
| public synchronized void | glGetBooleanv(int pname, boolean[] params, int offset)
checkThread();
int length = GLConfiguration.glGetNumParams(pname);
checkLength(params, length, offset);
qflush();
int[] iparams = new int[length];
IglGetBooleanv(pname, iparams, 0, length);
for (int i = 0; i < length; i++) {
params[offset + i] = (iparams[i] == 1);
}
| public synchronized void | glGetBooleanv(int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glGetNumParams(pname);
checkLength(params, length);
qflush();
if (!params.isDirect()) {
IglGetBooleanv(pname, params.array(), offset(params), length);
} else {
IglGetBooleanv(pname, null, pointer(params), length);
}
| public synchronized int | glGetError()
checkThread();
qflush();
grabContext();
int error = _glGetError();
return error;
| public synchronized void | glGetIntegerv(int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glGetNumParams(pname);
checkLength(params, length, offset);
qflush();
IglGetIntegerv(pname, params, offset, length);
// Workaround for Gerbera bug, CR 6401385
if (pname == GL_CULL_FACE) {
params[offset] = cullFaceMode;
}
| public synchronized void | glGetIntegerv(int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glGetNumParams(pname);
checkLength(params, length);
qflush();
if (!params.isDirect()) {
int[] array = params.array();
int offset = offset(params);
IglGetIntegerv(pname, array, offset, length);
// Workaround for Gerbera bug, CR 6401385
if (pname == GL_CULL_FACE) {
array[offset] = cullFaceMode;
}
} else {
IglGetIntegerv(pname, null, pointer(params), length);
// Workaround for Gerbera bug, CR 6401385
if (pname == GL_CULL_FACE) {
params.put(params.position(), cullFaceMode);
}
}
| public synchronized java.lang.String | glGetString(int name)
checkThread();
qflush();
grabContext();
String s = _glGetString(name);
return s;
| public synchronized void | glHint(int target, int mode)
checkThread();
q(CMD_HINT, 2);
q(target);
q(mode);
| public synchronized boolean | glIsBuffer(int buffer)
checkThread();
qflush();
grabContext();
boolean retval = GL_TRUE == _glIsBuffer(buffer);
return retval;
| public synchronized boolean | glIsEnabled(int cap)
checkThread();
qflush();
grabContext();
boolean retval = GL_TRUE == _glIsEnabled(cap);
return retval;
| public synchronized boolean | glIsTexture(int texture)
checkThread();
qflush();
grabContext();
boolean retval = false;
// Woraround for Gerbera bug, see CR 6401677
if (texture != 0) {
retval = GL_TRUE == _glIsTexture(texture);
}
return retval;
| public synchronized void | glLightModelf(int pname, float param)
checkThread();
q(CMD_LIGHT_MODELF, 2);
q(pname);
q(param);
| public synchronized void | glLightModelfv(int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glLightModelNumParams(pname);
checkLength(params, length, offset);
IglLightModelfv(pname, params, offset);
| public synchronized void | glLightModelfv(int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glLightModelNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglLightModelfv(pname, params.array(), offset(params));
return;
}
q(CMD_LIGHT_MODELFB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glLightModelx(int pname, int param)
checkThread();
q(CMD_LIGHT_MODELX, 2);
q(pname);
q(param);
| public synchronized void | glLightModelxv(int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glLightModelNumParams(pname);
checkLength(params, length, offset);
IglLightModelxv(pname, params, offset);
| public synchronized void | glLightModelxv(int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glLightModelNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglLightModelxv(pname, params.array(), offset(params));
return;
}
q(CMD_LIGHT_MODELXB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glLightf(int light, int pname, float param)
checkThread();
q(CMD_LIGHTF, 3);
q(light);
q(pname);
q(param);
| public synchronized void | glLightfv(int light, int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glLightNumParams(pname);
checkLength(params, length, offset);
IglLightfv(light, pname, params, offset);
| public synchronized void | glLightfv(int light, int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glLightNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglLightfv(light, pname, params.array(), offset(params));
return;
}
q(CMD_LIGHTFB, 3);
q(light);
q(pname);
q(params);
qflush();
| public synchronized void | glLightx(int light, int pname, int param)
checkThread();
q(CMD_LIGHTX, 3);
q(light);
q(pname);
q(param);
| public synchronized void | glLightxv(int light, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glLightNumParams(pname);
checkLength(params, length, offset);
IglLightxv(light, pname, params, offset);
| public synchronized void | glLightxv(int light, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glLightNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglLightxv(light, pname, params.array(), offset(params));
return;
}
q(CMD_LIGHTXB, 3);
q(light);
q(pname);
q(params);
qflush();
| public synchronized void | glLineWidth(float width)
checkThread();
q(CMD_LINE_WIDTH, 1);
q(width);
| public synchronized void | glLineWidthx(int width)
checkThread();
q(CMD_LINE_WIDTHX, 1);
q(width);
| public synchronized void | glLoadIdentity()
checkThread();
q(CMD_LOAD_IDENTITY, 0);
| public synchronized void | glLoadMatrixf(float[] m, int offset)
checkThread();
checkLength(m, 16, offset);
IglLoadMatrixf(m, offset);
| public synchronized void | glLoadMatrixf(java.nio.FloatBuffer m)
checkThread();
checkLength(m, 16);
if (!m.isDirect()) {
IglLoadMatrixf(m.array(), offset(m));
return;
}
q(CMD_LOAD_MATRIXFB, 1);
q(m);
qflush();
| public synchronized void | glLoadMatrixx(int[] m, int offset)
checkThread();
checkLength(m, 16, offset);
IglLoadMatrixx(m, offset);
| public synchronized void | glLoadMatrixx(java.nio.IntBuffer m)
checkThread();
checkLength(m, 16);
if (!m.isDirect()) {
IglLoadMatrixx(m.array(), offset(m));
return;
}
q(CMD_LOAD_MATRIXXB, 1);
q(m);
qflush();
| public synchronized void | glLogicOp(int opcode)
checkThread();
q(CMD_LOGIC_OP, 1);
q(opcode);
| public synchronized void | glMaterialf(int face, int pname, float param)
checkThread();
q(CMD_MATERIALF, 3);
q(face);
q(pname);
q(param);
| public synchronized void | glMaterialfv(int face, int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glMaterialNumParams(pname);
checkLength(params, length, offset);
IglMaterialfv(face, pname, params, offset);
| public synchronized void | glMaterialfv(int face, int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glMaterialNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglMaterialfv(face, pname, params.array(), offset(params));
return;
}
q(CMD_MATERIALFB, 3);
q(face);
q(pname);
q(params);
qflush();
| public synchronized void | glMaterialx(int face, int pname, int param)
checkThread();
q(CMD_MATERIALX, 3);
q(face);
q(pname);
q(param);
| public synchronized void | glMaterialxv(int face, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glMaterialNumParams(pname);
checkLength(params, length, offset);
IglMaterialxv(face, pname, params, offset);
| public synchronized void | glMaterialxv(int face, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glMaterialNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglMaterialxv(face, pname, params.array(), offset(params));
return;
}
q(CMD_MATERIALXB, 3);
q(face);
q(pname);
q(params);
qflush();
| public synchronized void | glMatrixMode(int mode)
checkThread();
q(CMD_MATRIX_MODE, 1);
q(mode);
| public synchronized void | glMultMatrixf(float[] m, int offset)
checkThread();
checkLength(m, 16, offset);
IglMultMatrixf(m, offset);
| public synchronized void | glMultMatrixf(java.nio.FloatBuffer m)
checkThread();
checkLength(m, 16);
if (!m.isDirect()) {
IglMultMatrixf(m.array(), offset(m));
return;
}
q(CMD_MULT_MATRIXFB, 1);
q(m);
qflush();
| public synchronized void | glMultMatrixx(int[] m, int offset)
checkThread();
checkLength(m, 16, offset);
IglMultMatrixx(m, offset);
| public synchronized void | glMultMatrixx(java.nio.IntBuffer m)
checkThread();
checkLength(m, 16);
if (!m.isDirect()) {
IglMultMatrixx(m.array(), offset(m));
return;
}
q(CMD_MULT_MATRIXXB, 1);
q(m);
qflush();
| public synchronized void | glMultiTexCoord4f(int target, float s, float t, float r, float q)
checkThread();
q(CMD_MULTI_TEXT_COORD4F, 5);
q(target);
q(s);
q(t);
q(r);
q(q);
| public synchronized void | glMultiTexCoord4x(int target, int s, int t, int r, int q)
checkThread();
q(CMD_MULTI_TEXT_COORD4X, 5);
q(target);
q(s);
q(t);
q(r);
q(q);
| public synchronized void | glNormal3f(float nx, float ny, float nz)
checkThread();
q(CMD_NORMAL3F, 3);
q(nx);
q(ny);
q(nz);
| public synchronized void | glNormal3x(int nx, int ny, int nz)
checkThread();
q(CMD_NORMAL3X, 3);
q(nx);
q(ny);
q(nz);
| public synchronized void | glNormalPointer(int type, int stride, java.nio.Buffer pointer)
checkThread();
if (VBOArrayBufferBound != 0) {
throw new IllegalStateException("glNormalPointer:" +
Errors.VBO_ARRAY_BUFFER_BOUND);
}
if (!isDirect(pointer)) {
throwIAE(Errors.GL_NOT_DIRECT);
}
if ((type == GL_BYTE ||
type == GL_SHORT ||
type == GL_FIXED ||
type == GL_FLOAT) &&
(stride >= 0)) {
BufferManager.releaseBuffer(pointerBuffer[NORMAL_POINTER]);
BufferManager.useBuffer(pointer);
pointerBuffer[NORMAL_POINTER] = pointer;
pointerSize[NORMAL_POINTER] = 3;
pointerType[NORMAL_POINTER] = type;
pointerStride[NORMAL_POINTER] = stride;
int nbytes = bufferTypeSize(pointer);
pointerRemaining[NORMAL_POINTER] = pointer.remaining()*nbytes;
pointerOffset[NORMAL_POINTER] = 0;
}
q(CMD_NORMAL_POINTER, 3);
q(type);
q(stride);
q(pointer);
qflush();
| public synchronized void | glOrthof(float left, float right, float bottom, float top, float zNear, float zFar)
checkThread();
q(CMD_ORTHOF, 6);
q(left);
q(right);
q(bottom);
q(top);
q(zNear);
q(zFar);
| public synchronized void | glOrthox(int left, int right, int bottom, int top, int zNear, int zFar)
checkThread();
q(CMD_ORTHOX, 6);
q(left);
q(right);
q(bottom);
q(top);
q(zNear);
q(zFar);
| public synchronized void | glPixelStorei(int pname, int param)
checkThread();
q(CMD_PIXEL_STOREI, 3);
q(pname);
q(param);
/* Only update local copy if we know command will succeed */
if (param == 1 || param == 2 || param == 4 || param == 8) {
if (pname == GL_PACK_ALIGNMENT) {
pixelStorePackAlignment = param;
} else if (pname == GL_UNPACK_ALIGNMENT) {
pixelStoreUnpackAlignment = param;
}
}
| public synchronized void | glPointParameterf(int pname, float param)
checkThread();
q(CMD_POINT_PARAMETERF, 2);
q(pname);
q(param);
| public synchronized void | glPointParameterfv(int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glPointParameterNumParams(pname);
checkLength(params, length, offset);
IglPointParameterfv(pname, params, offset);
| public synchronized void | glPointParameterfv(int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glPointParameterNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglPointParameterfv(pname, params.array(), offset(params));
return;
}
q(CMD_POINT_PARAMETERFB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glPointParameterx(int pname, int param)
checkThread();
q(CMD_POINT_PARAMETERX, 2);
q(pname);
q(param);
| public synchronized void | glPointParameterxv(int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glPointParameterNumParams(pname);
checkLength(params, length, offset);
IglPointParameterxv(pname, params, offset);
| public synchronized void | glPointParameterxv(int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glPointParameterNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglPointParameterxv(pname, params.array(), offset(params));
return;
}
q(CMD_POINT_PARAMETERXB, 2);
q(pname);
q(params);
qflush();
| public synchronized void | glPointSize(float size)
checkThread();
q(CMD_POINT_SIZE, 1);
q(size);
| public synchronized void | glPointSizex(int size)
checkThread();
q(CMD_POINT_SIZEX, 1);
q(size);
| public synchronized void | glPolygonOffset(float factor, float units)
checkThread();
q(CMD_POLYGON_OFFSET, 2);
q(factor);
q(units);
| public synchronized void | glPolygonOffsetx(int factor, int units)
checkThread();
q(CMD_POLYGON_OFFSETX, 2);
q(factor);
q(units);
| public synchronized void | glPopMatrix()
checkThread();
q(CMD_POP_MATRIX, 0);
| public synchronized void | glPushMatrix()
checkThread();
q(CMD_PUSH_MATRIX, 0);
| public synchronized int | glQueryMatrixxOES(int[] mantissa, int mantissaOffset, int[] exponent, int exponentOffset)
checkThread();
if (!GLConfiguration.supports_OES_query_matrix) {
throw new UnsupportedOperationException(
Errors.GL_QUERY_MATRIX_UNSUPPORTED);
}
checkLength(mantissa, 16, mantissaOffset);
checkLength(exponent, 16, exponentOffset);
qflush();
grabContext();
int retval = _glQueryMatrixxOES(mantissa, mantissaOffset,
exponent, exponentOffset);
return retval;
| public synchronized void | glReadPixels(int x, int y, int width, int height, int format, int type, java.nio.Buffer pixels)
checkThread();
qflush();
if (pixels == null) {
throwIAE(Errors.GL_PIXELS_NULL);
}
int remaining = pixels.remaining()*bufferTypeSize(pixels);
int needed = rasterBytes(width, height, format, type,
pixelStorePackAlignment);
if (needed > remaining) {
throwIAE(Errors.NOT_ENOUGH_ROOM);
}
if (isDirect(pixels)) {
grabContext();
_glReadPixelsPtr(x, y, width, height, format,
type, pointer(pixels));
} else {
if (pixels instanceof ByteBuffer) {
ByteBuffer p = (ByteBuffer)pixels;
grabContext();
_glReadPixelsByte(x, y, width, height, format, type,
p.array(), offset(p));
} else if (pixels instanceof IntBuffer) {
IntBuffer p = (IntBuffer)pixels;
grabContext();
_glReadPixelsInt(x, y, width, height, format, type,
p.array(), offset(p));
} else {
throwIAE(Errors.GL_UNKNOWN_BUFFER);
}
}
| public synchronized void | glRotatef(float angle, float x, float y, float z)
checkThread();
q(CMD_ROTATEF, 4);
q(angle);
q(x);
q(y);
q(z);
| public synchronized void | glRotatex(int angle, int x, int y, int z)
checkThread();
q(CMD_ROTATEX, 4);
q(angle);
q(x);
q(y);
q(z);
| public synchronized void | glSampleCoverage(float value, boolean invert)
checkThread();
q(CMD_SAMPLE_COVERAGE, 2);
q(value);
q(invert ? 1 : 0);
| public synchronized void | glSampleCoveragex(int value, boolean invert)
checkThread();
q(CMD_SAMPLE_COVERAGEX, 2);
q(value);
q(invert ? 1 : 0);
| public synchronized void | glScalef(float x, float y, float z)
checkThread();
q(CMD_SCALEF, 3);
q(x);
q(y);
q(z);
| public synchronized void | glScalex(int x, int y, int z)
checkThread();
q(CMD_SCALEX, 3);
q(x);
q(y);
q(z);
| public synchronized void | glScissor(int x, int y, int width, int height)
checkThread();
q(CMD_SCISSOR, 4);
q(x);
q(y);
q(width);
q(height);
| public synchronized void | glShadeModel(int mode)
checkThread();
q(CMD_SHADE_MODEL, 1);
q(mode);
| public synchronized void | glStencilFunc(int func, int ref, int mask)
checkThread();
q(CMD_STENCIL_FUNC, 3);
q(func);
q(ref);
q(mask);
| public synchronized void | glStencilMask(int mask)
checkThread();
q(CMD_STENCIL_MASK, 2);
q(mask);
| public synchronized void | glStencilOp(int fail, int zfail, int zpass)
checkThread();
q(CMD_STENCIL_OP, 3);
q(fail);
q(zfail);
q(zpass);
| public synchronized void | glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer)
checkThread();
if (VBOArrayBufferBound != 0) {
throw new IllegalStateException("glTexCoordPointer:" +
Errors.VBO_ARRAY_BUFFER_BOUND);
}
if (!isDirect(pointer)) {
throwIAE(Errors.GL_NOT_DIRECT);
}
if ((size >= 2 && size <= 4) &&
(type == GL_BYTE ||
type == GL_SHORT ||
type == GL_FIXED ||
type == GL_FLOAT) &&
(stride >= 0)) {
BufferManager.releaseBuffer(pointerBuffer[TEX_COORD_POINTER]);
BufferManager.useBuffer(pointer);
pointerBuffer[TEX_COORD_POINTER] = pointer;
pointerSize[TEX_COORD_POINTER] = size;
pointerType[TEX_COORD_POINTER] = type;
pointerStride[TEX_COORD_POINTER] = stride;
int nbytes = bufferTypeSize(pointer);
pointerRemaining[TEX_COORD_POINTER] = pointer.remaining()*nbytes;
pointerOffset[TEX_COORD_POINTER] = 0;
}
q(CMD_TEX_COORD_POINTER, 4);
q(size);
q(type);
q(stride);
q(pointer);
qflush();
| public synchronized void | glTexEnvf(int target, int pname, float param)
checkThread();
q(CMD_TEX_ENVF, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexEnvfv(int target, int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length, offset);
IglTexEnvfv(target, pname, params, offset);
| public synchronized void | glTexEnvfv(int target, int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexEnvfv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_ENVFB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexEnvi(int target, int pname, int param)
checkThread();
q(CMD_TEX_ENVI, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexEnviv(int target, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length, offset);
IglTexEnviv(target, pname, params, offset);
| public synchronized void | glTexEnviv(int target, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexEnviv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_ENVIB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexEnvx(int target, int pname, int param)
checkThread();
q(CMD_TEX_ENVX, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexEnvxv(int target, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length, offset);
IglTexEnvxv(target, pname, params, offset);
| public synchronized void | glTexEnvxv(int target, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glTexEnvNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexEnvxv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_ENVXB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, java.nio.Buffer pixels)
checkThread();
boolean isReadOnly = false;
if (!isDirect(pixels)) {
pixels = createDirectCopy(pixels);
isReadOnly = true;
}
int remaining = pixels.remaining()*bufferTypeSize(pixels);
int needed = rasterBytes(width, height, format, type,
pixelStoreUnpackAlignment);
if (needed > remaining) {
throwIAE(Errors.NOT_ENOUGH_ROOM);
}
q(CMD_TEX_IMAGE_2D, 9);
q(target);
q(level);
q(internalformat);
q(width);
q(height);
q(border);
q(format);
q(type);
q(pixels);
if (!isReadOnly) {
qflush();
}
| public synchronized void | glTexParameterf(int target, int pname, float param)
checkThread();
q(CMD_TEX_PARAMETERF, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexParameterfv(int target, int pname, float[] params, int offset)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length, offset);
IglTexParameterfv(target, pname, params, offset);
| public synchronized void | glTexParameterfv(int target, int pname, java.nio.FloatBuffer params)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexParameterfv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_PARAMETERFB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexParameteri(int target, int pname, int param)
checkThread();
q(CMD_TEX_PARAMETERI, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexParameteriv(int target, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length, offset);
IglTexParameteriv(target, pname, params, offset);
| public synchronized void | glTexParameteriv(int target, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexParameteriv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_PARAMETERIB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexParameterx(int target, int pname, int param)
checkThread();
q(CMD_TEX_PARAMETERX, 3);
q(target);
q(pname);
q(param);
| public synchronized void | glTexParameterxv(int target, int pname, int[] params, int offset)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length, offset);
IglTexParameterxv(target, pname, params, offset);
| public synchronized void | glTexParameterxv(int target, int pname, java.nio.IntBuffer params)
checkThread();
int length = GLConfiguration.glTexParameterNumParams(pname);
checkLength(params, length);
if (!params.isDirect()) {
IglTexParameterxv(target, pname, params.array(), offset(params));
return;
}
q(CMD_TEX_PARAMETERXB, 3);
q(target);
q(pname);
q(params);
qflush();
| public synchronized void | glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, java.nio.Buffer pixels)
checkThread();
if ((pixels instanceof ShortBuffer) ||
(pixels instanceof IntBuffer)) {
throwIAE(Errors.GL_PIXELS_NOT_SHORT_OR_INT);
}
boolean isReadOnly = false;
if (!isDirect(pixels)) {
pixels = createDirectCopy(pixels);
isReadOnly = true;
}
int remaining = pixels.remaining()*bufferTypeSize(pixels);
int needed = rasterBytes(width, height, format, type,
pixelStoreUnpackAlignment);
if (needed > remaining) {
throwIAE(Errors.NOT_ENOUGH_ROOM);
}
q(CMD_TEX_SUB_IMAGE_2D, 9);
q(target);
q(level);
q(xoffset);
q(yoffset);
q(width);
q(height);
q(format);
q(type);
q(pixels);
if (!isReadOnly) {
qflush();
}
| public synchronized void | glTranslatef(float x, float y, float z)
checkThread();
q(CMD_TRANSLATEF, 3);
q(x);
q(y);
q(z);
| public synchronized void | glTranslatex(int x, int y, int z)
checkThread();
q(CMD_TRANSLATEX, 3);
q(x);
q(y);
q(z);
| public synchronized void | glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer)
checkThread();
if (VBOArrayBufferBound != 0) {
throw new IllegalStateException("glVertexPointer:" +
Errors.VBO_ARRAY_BUFFER_BOUND);
}
if (!isDirect(pointer)) {
throwIAE(Errors.GL_NOT_DIRECT);
}
// Only record details if this is a legal operation
if ((size >= 2 && size <= 4) &&
(type == GL_BYTE ||
type == GL_SHORT ||
type == GL_FIXED ||
type == GL_FLOAT) &&
(stride >= 0)) {
BufferManager.releaseBuffer(pointerBuffer[VERTEX_POINTER]);
BufferManager.useBuffer(pointer);
pointerBuffer[VERTEX_POINTER] = pointer;
pointerSize[VERTEX_POINTER] = size;
pointerType[VERTEX_POINTER] = type;
pointerStride[VERTEX_POINTER] = stride;
int nbytes = bufferTypeSize(pointer);
pointerRemaining[VERTEX_POINTER] = pointer.remaining()*nbytes;
pointerOffset[VERTEX_POINTER] = 0;
}
q(CMD_VERTEX_POINTER, 4);
q(size);
q(type);
q(stride);
q(pointer);
qflush();
| public synchronized void | glViewport(int x, int y, int width, int height)
checkThread();
q(CMD_VIEWPORT, 4);
q(x);
q(y);
q(width);
q(height);
| public static void | grabContext()Set the context associated with the current Java thread as the
native context. This is only necessary if we are on a
single-threaded VM and the context is not already current.
if (!GLConfiguration.singleThreaded) {
return;
}
// Locate the desired context for this Java thread
Thread currentThread = Thread.currentThread();
EGLContext newContext =
(EGLContext)contextsByThread.get(currentThread);
if (newContext == GL10Impl.currentContext) {
return;
}
if (newContext != null) {
EGLDisplay display = ((ContextAccess) newContext).getDisplay();
EGLSurface draw = ((ContextAccess) newContext).getDrawSurface();
EGLSurface read = ((ContextAccess) newContext).getReadSurface();
egl.eglMakeCurrent(display, draw, read, newContext);
GL10Impl.currentContext = newContext;
}
| boolean | isDirect(java.nio.Buffer buf)
if (buf instanceof ByteBuffer) {
return ((ByteBuffer)buf).isDirect();
} else if (buf instanceof ShortBuffer) {
return ((ShortBuffer)buf).isDirect();
} else if (buf instanceof IntBuffer) {
return ((IntBuffer)buf).isDirect();
} else if (buf instanceof FloatBuffer) {
return ((FloatBuffer)buf).isDirect();
} else {
throw new IllegalArgumentException(Errors.GL_UNKNOWN_BUFFER);
}
| private java.lang.Integer | key(int target)
if (target == GL11.GL_ARRAY_BUFFER) {
return new Integer(VBOArrayBufferBound);
} else if (target == GL11.GL_ELEMENT_ARRAY_BUFFER) {
return new Integer(VBOElementArrayBufferBound);
} else {
throw new IllegalArgumentException("target = " + target);
}
| int | offset(java.nio.ByteBuffer buffer)
return buffer.arrayOffset() + buffer.position();
| int | offset(java.nio.ShortBuffer buffer)
return buffer.arrayOffset() + buffer.position();
| int | offset(java.nio.IntBuffer buffer)
return buffer.arrayOffset() + buffer.position();
| int | offset(java.nio.FloatBuffer buffer)
return buffer.arrayOffset() + buffer.position();
| int | pointer(java.nio.Buffer buffer)
int offset = buffer.position();
int nativeAddress = _getNativeAddress(buffer, offset);
return nativeAddress;
| void | q(int cmd, int count)
if (index + count + 1 >= GLConfiguration.COMMAND_QUEUE_SIZE) {
qflush();
}
if (debugQueue) {
System.out.println("Queueing command " +
commandStrings[cmd] + " with " +
count + " args from thread " +
Thread.currentThread());
}
queue[index++] = cmd;
commandsLeft = count;
| void | q(int i)
queue[index++] = i;
if (debugQueue) {
System.out.println("Queueing integer " + i +
" from thread " +
Thread.currentThread());
}
if (GLConfiguration.flushQueueAfterEachCommand &&
(--commandsLeft == 0)) {
if (debugQueue) {
System.out.println("Last arg for command, flushing");
}
qflush();
}
| void | q(float f)
int i = floatToIntBits(f);
queue[index++] = i;
if (debugQueue) {
System.out.println("Queueing float " + f +
" from thread " +
Thread.currentThread());
}
if (GLConfiguration.flushQueueAfterEachCommand &&
(--commandsLeft == 0)) {
if (debugQueue) {
System.out.println("Last arg for command, flushing");
}
qflush();
}
| void | q(java.nio.Buffer buf)
q(pointer(buf));
if (debugQueue) {
System.out.println("Queueing buffer pointer " + pointer(buf) +
" from thread " +
Thread.currentThread());
}
if (GLConfiguration.flushQueueAfterEachCommand &&
(--commandsLeft == 0)) {
if (debugQueue) {
System.out.println("Last arg for command, flushing");
}
qflush();
}
| public void | qflush()
if (debugQueue) {
System.out.println("Flushing the queue, index = " + index);
}
grabContext();
_execute(queue, index);
index = 0;
// Ensure GL does not starve other threads
Thread.yield();
| private int | rasterBytes(int width, int height, int format, int type, int pad)
int bytesPerPixel = GLConfiguration.formatChannels(format)*
GLConfiguration.sizeOfType(type);
int rowWidth = width*bytesPerPixel;
// stride = rowWidth rounded up to a multiple of 'pad' bytes
int stride = (rowWidth + pad - 1) & ~(pad - 1);
return stride*(height - 1) + rowWidth;
| void | removeBuffer(int buffer)
if (DEBUG_MEM) {
System.out.println("removeBuffer " + buffer);
}
if (buffer != 0) {
Integer key = new Integer(buffer);
VBOBuffersTable.remove(key);
VBOBufferSizeTable.remove(key);
VBOBufferIndicesTable.remove(key);
}
| void | setBufferSize(int target, int size)
if (DEBUG_MEM) {
System.out.println("setBufferSize " + target + " " + size);
}
Integer key = key(target);
if (target == GL11.GL_ELEMENT_ARRAY_BUFFER) {
if (DEBUG_MEM) {
System.out.print("setBufferSize: allocating " + size);
}
VBOBufferIndicesTable.put(key, new byte[size]);
if (DEBUG_MEM) {
System.out.println(": done");
}
}
VBOBufferSizeTable.put(key, new Integer(size));
| void | throwIAE(java.lang.String message)
throw new IllegalArgumentException(message);
|
|