mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-04 22:17:59 +00:00
Move native stub initialization from extgl into GLContext.java. Makes it much easier to
exlude extensions classes. Furthermore, GLContext.useContext(null) can now be used to reset the native stubs when no context is current.
This commit is contained in:
parent
2cc7e0d02f
commit
15934fd6e7
122 changed files with 842 additions and 1033 deletions
|
|
@ -68,6 +68,8 @@ public final class ARBBufferObject {
|
|||
public static final int GL_BUFFER_MAPPED_ARB = 0x88BC;
|
||||
public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glBindBufferARB(int target, int buffer) {
|
||||
switch (target) {
|
||||
case ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB:
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ public final class ARBImaging {
|
|||
public static final int GL_MINMAX_FORMAT = 0x802F;
|
||||
public static final int GL_MINMAX_SINK = 0x8030;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) {
|
||||
BufferChecks.checkBuffer(data, 256);
|
||||
nglColorTable(target, internalFormat, width, format, type, data, data.position());
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ public final class ARBMatrixPalette {
|
|||
public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
|
||||
public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glCurrentPaletteMatrixARB(int index);
|
||||
public static void glMatrixIndexPointerARB(int size, int stride, ByteBuffer pPointer) {
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public final class ARBMultisample {
|
|||
public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB;
|
||||
public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glSampleCoverageARB(float value, boolean invert);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ public final class ARBMultitexture {
|
|||
public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1;
|
||||
public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glClientActiveTextureARB(int texture);
|
||||
|
||||
public static native void glActiveTextureARB(int texture);
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public final class ARBOcclusionQuery {
|
|||
public static final int GL_QUERY_RESULT_ARB = 0x8866;
|
||||
public static final int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glGenQueriesARB(IntBuffer ids) {
|
||||
nglGenQueriesARB(ids.remaining(), ids, ids.position());
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public final class ARBPointParameters {
|
|||
public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
|
||||
public static final int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glPointParameterfARB(int pname, float param);
|
||||
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ public class ARBProgram {
|
|||
public static final int GL_MATRIX31_ARB = 0x88DF;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glProgramStringARB(int target, int format, ByteBuffer string) {
|
||||
nglProgramStringARB(target, format, string.remaining(), string, string.position());
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@ public final class ARBShaderObjects {
|
|||
public static final int GL_SAMPLER_2D_RECT_ARB = 0x8B63;
|
||||
public static final int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glDeleteObjectARB(int obj);
|
||||
|
||||
public static native int glGetHandleARB(int pname);
|
||||
|
|
@ -380,4 +382,4 @@ public final class ARBShaderObjects {
|
|||
IntBuffer length, int lengthOffset, ByteBuffer source, int sourceOffset);
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ public final class ARBTextureCompression
|
|||
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2;
|
||||
public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) {
|
||||
nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public final class ARBTransposeMatrix {
|
|||
public static final int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5;
|
||||
public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glLoadTransposeMatrixARB(FloatBuffer pfMtx) {
|
||||
BufferChecks.checkBuffer(pfMtx, 16);
|
||||
nglLoadTransposeMatrixfARB(pfMtx, pfMtx.position());
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ public final class ARBVertexBlend {
|
|||
public static final int GL_MODELVIEW30_ARB = 0x873E;
|
||||
public static final int GL_MODELVIEW31_ARB = 0x873F;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glWeightARB(ByteBuffer pWeights) {
|
||||
nglWeightbvARB(pWeights.remaining(), pWeights, pWeights.position());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ public final class ARBVertexProgram extends ARBProgram {
|
|||
*/
|
||||
public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glVertexAttrib1sARB(int index, short x);
|
||||
|
||||
public static native void glVertexAttrib1fARB(int index, float x);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ public final class ARBVertexShader {
|
|||
public static final int GL_FLOAT_MAT3_ARB = 0x8B5B;
|
||||
public static final int GL_FLOAT_MAT4_ARB = 0x8B5C;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glBindAttribLocationARB(int programObj, int index, ByteBuffer name) {
|
||||
if ( name.get(name.limit() - 1) != 0 ) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
package org.lwjgl.opengl;
|
||||
|
||||
public final class ARBWindowPos {
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glWindowPos2fARB(float x, float y);
|
||||
|
||||
public static native void glWindowPos2iARB(int x, int y);
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public final class ATIDrawBuffers {
|
|||
public static final int GL_DRAW_BUFFER15_ATI = 0x8834;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glDrawBuffersATI(IntBuffer buffers) {
|
||||
if (buffers.remaining() == 0) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public final class ATIElementArray {
|
|||
public static final int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769;
|
||||
public static final int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glElementPointerATI(ByteBuffer pPointer) {
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
nglElementPointerATI(GL11.GL_UNSIGNED_BYTE, pPointer, pPointer.position());
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ public final class ATIEnvmapBumpmap {
|
|||
public static final int GL_BUMP_ENVMAP_ATI = 0x877B;
|
||||
public static final int GL_BUMP_TARGET_ATI = 0x877C;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glTexBumpParameterATI(int pname, FloatBuffer pfParam) {
|
||||
BufferChecks.checkBuffer(pfParam);
|
||||
nglTexBumpParameterfvATI(pname, pfParam, pfParam.position());
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public final class ATIFragmentShader {
|
|||
public static final int GL_NEGATE_BIT_ATI = 0x00000004;
|
||||
public static final int GL_BIAS_BIT_ATI = 0x00000008;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native int glGenFragmentShadersATI(int range);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ import java.nio.ByteBuffer;
|
|||
|
||||
public final class ATIMapObjectBuffer {
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
/**
|
||||
* glMapObjectBufferATI maps a gl object buffer to a ByteBuffer. The oldBuffer argument can be
|
||||
* null, in which case a new ByteBuffer will be created, pointing to the returned memory. If
|
||||
|
|
@ -52,4 +54,4 @@ public final class ATIMapObjectBuffer {
|
|||
|
||||
public static native void glUnmapObjectBufferATI(int buffer);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public final class ATIPnTriangles {
|
|||
public static final int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7;
|
||||
public static final int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glPNTrianglesfATI(int pname, float param);
|
||||
|
||||
public static native void glPNTrianglesiATI(int pname, int param);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ public final class ATISeparateStencil {
|
|||
public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802;
|
||||
public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glStencilOpSeparateATI(int face, int sfail, int dpfail, int dppass);
|
||||
public static native void glStencilFuncSeparateATI(int frontfunc, int backfunc, int ref, int mask);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public final class ATIVertexArrayObject {
|
|||
public static final int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766;
|
||||
public static final int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static int glNewObjectBufferATI(int size, ByteBuffer pPointer, int usage) {
|
||||
return nglNewObjectBufferATI(size, pPointer, pPointer != null ? pPointer.position() : 0, usage);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ import java.nio.IntBuffer;
|
|||
|
||||
public final class ATIVertexAttribArrayObject {
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glVertexAttribArrayObjectATI(int index, int size, int type,
|
||||
boolean normalized, int stride, int buffer,
|
||||
int offset);
|
||||
|
|
@ -61,4 +63,4 @@ public final class ATIVertexAttribArrayObject {
|
|||
IntBuffer params, int paramsOffset);
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public final class ATIVertexStreams {
|
|||
public static final int GL_VERTEX_STREAM6_ATI = 0x8773;
|
||||
public static final int GL_VERTEX_STREAM7_ATI = 0x8774;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glVertexStream1fATI(int stream, float x);
|
||||
public static native void glVertexStream1iATI(int stream, int x);
|
||||
public static native void glVertexStream1sATI(int stream, short x);
|
||||
|
|
|
|||
|
|
@ -462,9 +462,10 @@ public final class Display {
|
|||
private static native void swapBuffers();
|
||||
|
||||
/**
|
||||
* Make the Display the current rendering context for GL calls.
|
||||
* Make the Display the current rendering context for GL calls. Also initialize native stubs.
|
||||
* @throws LWJGLException If the context could not be made current
|
||||
*/
|
||||
public static synchronized void makeCurrent() {
|
||||
public static synchronized void makeCurrent() throws LWJGLException {
|
||||
if (!isCreated())
|
||||
throw new IllegalStateException("No window created to make current");
|
||||
nMakeCurrent();
|
||||
|
|
@ -474,7 +475,7 @@ public final class Display {
|
|||
/**
|
||||
* Make the window the current rendering context for GL calls.
|
||||
*/
|
||||
private static native void nMakeCurrent();
|
||||
private static native void nMakeCurrent() throws LWJGLException;
|
||||
|
||||
/**
|
||||
* Create the OpenGL context. If isFullscreen() is true or if windowed
|
||||
|
|
@ -596,6 +597,11 @@ public final class Display {
|
|||
destroyWindow();
|
||||
destroyContext();
|
||||
context = null;
|
||||
try {
|
||||
GLContext.useContext(null);
|
||||
} catch (LWJGLException e) {
|
||||
// ignore exception
|
||||
}
|
||||
reset();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public final class EXTBlendEquationSeparate {
|
|||
public static final int GL_BLEND_EQUATION_RGB_EXT = 0x8009;
|
||||
public static final int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glBlendEquationSeparateEXT(int modeRGB, int modeAlpha);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,5 +41,7 @@ public final class EXTBlendFuncSeparate {
|
|||
public static final int GL_BLEND_DST_ALPHA_EXT = 0x80CA;
|
||||
public static final int GL_BLEND_SRC_ALPHA_EXT = 0x80CB;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glBlendFuncSeparateEXT(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ public final class EXTCompiledVertexArray {
|
|||
public static final int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8;
|
||||
public static final int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glLockArraysEXT(int first, int count);
|
||||
public static native void glUnlockArraysEXT();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public final class EXTDepthBoundsTest {
|
|||
*/
|
||||
public static final int DEPTH_BOUNDS_EXT = 0x8891;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glDepthBoundsEXT(float zmin, float zmax);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public final class EXTDrawRangeElements {
|
|||
public static final int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8;
|
||||
public static final int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glDrawRangeElementsEXT(int mode, int start, int end, ByteBuffer pIndices) {
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElementsEXT(mode, start, end, pIndices.remaining(), GL11.GL_UNSIGNED_BYTE, pIndices, pIndices.position());
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public final class EXTFogCoord {
|
|||
public static final int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glFogCoordfEXT(float coord);
|
||||
public static void glFogCoordPointerEXT(int stride, FloatBuffer data) {
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ package org.lwjgl.opengl;
|
|||
import java.nio.IntBuffer;
|
||||
|
||||
public final class EXTMultiDrawArrays {
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glMultiDrawArraysEXT(int mode, IntBuffer piFirst, IntBuffer piCount) {
|
||||
if (piFirst.remaining() != piCount.remaining()) {
|
||||
throw new IllegalArgumentException("piFirst.remaining() != piCount.remaining()");
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public final class EXTPointParameters {
|
|||
public static final int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128;
|
||||
public static final int GL_DISTANCE_ATTENUATION_EXT = 0x8129;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glPointParameterfEXT(int pname, float param);
|
||||
|
||||
public static void glPointParameterEXT(int pname, FloatBuffer pfParams) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public final class EXTSecondaryColor {
|
|||
public static final int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D;
|
||||
public static final int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glSecondaryColor3bEXT(byte red, byte green, byte blue);
|
||||
|
||||
public static native void glSecondaryColor3fEXT(float red, float green, float blue);
|
||||
|
|
|
|||
|
|
@ -35,5 +35,7 @@ public final class EXTStencilTwoSide {
|
|||
public static final int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910;
|
||||
public static final int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glActiveStencilFaceEXT(int face);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ public final class EXTVertexShader {
|
|||
public static final int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC;
|
||||
public static final int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glBeginVertexShaderEXT();
|
||||
public static native void glEndVertexShaderEXT();
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ public final class EXTVertexWeighting {
|
|||
public static final int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F;
|
||||
public static final int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glVertexWeightfEXT(float weight);
|
||||
|
||||
public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) {
|
||||
|
|
|
|||
|
|
@ -719,7 +719,9 @@ public final class GL11 {
|
|||
/* For compatibility with OpenGL v1.0 */
|
||||
public static final int GL_LOGIC_OP = GL_INDEX_LOGIC_OP;
|
||||
public static final int GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT;
|
||||
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glAccum(int op, float value);
|
||||
public static native void glAlphaFunc(int func, float ref);
|
||||
public static native void glClearColor(float red, float green, float blue, float alpha);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ public final class GL12 {
|
|||
public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
|
||||
public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) {
|
||||
BufferChecks.ensureElementVBOdisabled();
|
||||
nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_BYTE, indices, indices.position());
|
||||
|
|
|
|||
|
|
@ -148,6 +148,8 @@ public final class GL13 {
|
|||
public static final int GL_DOT3_RGBA = 0x86AF;
|
||||
public static final int GL_CLAMP_TO_BORDER = 0x812D;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glActiveTexture(int texture);
|
||||
public static native void glClientActiveTexture(int texture);
|
||||
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) {
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ public final class GL14 {
|
|||
public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD;
|
||||
public static final int GL_GL_MIRRORED_REPEAT = 0x8370;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glBlendEquation(int mode);
|
||||
public static native void glBlendColor(float red, float green, float blue, float alpha);
|
||||
public static native void glFogCoordf(float coord);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public final class GL15 {
|
|||
public static final int GL_BUFFER_MAPPED = 0x88BC;
|
||||
public static final int GL_BUFFER_MAP_POINTER = 0x88BD;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glBindBuffer(int target, int buffer) {
|
||||
switch ( target ) {
|
||||
case GL_ELEMENT_ARRAY_BUFFER:
|
||||
|
|
|
|||
|
|
@ -36,8 +36,15 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Iterator;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLException;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
|
|
@ -174,6 +181,9 @@ public final class GLContext {
|
|||
public static boolean OpenGL14;
|
||||
public static boolean OpenGL15;
|
||||
|
||||
/** Map of classes that have native stubs loaded */
|
||||
private static Map exts;
|
||||
|
||||
static {
|
||||
Sys.initialize();
|
||||
}
|
||||
|
|
@ -204,18 +214,21 @@ public final class GLContext {
|
|||
/**
|
||||
* Makes a GL context the current context. This method does not make the context current though!
|
||||
* Instead it simply ensures that the current context is reflected accurately by GLContext's
|
||||
* extension caps and function pointers.
|
||||
* extension caps and function pointers. Use useContext(null) when no context is active.
|
||||
* <p>If the context is the same as last time, then this is a no-op.
|
||||
* <p>If the context has not been encountered before it will be fully initialized from scratch.
|
||||
* Otherwise a cached set of caps and function pointers will be used.
|
||||
* <p>The reference to the context is held in a weak reference; therefore if no strong reference
|
||||
* exists to the GL context it will automatically be forgotten by the VM at an indeterminate point
|
||||
* in the future, freeing up a little RAM.
|
||||
* @param context The context object, which uniquely identifies a GL context
|
||||
* @param context The context object, which uniquely identifies a GL context. If context is null,
|
||||
* the native stubs are unloaded.
|
||||
* @throws LWJGLException if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loaded
|
||||
*/
|
||||
public static synchronized void useContext(Object context) {
|
||||
public static synchronized void useContext(Object context) throws LWJGLException {
|
||||
if (context == null) {
|
||||
throw new NullPointerException("Can't use a null context");
|
||||
unloadStubs();
|
||||
return;
|
||||
}
|
||||
// Is this the same as last time?
|
||||
Object current = currentContext == null ? null : currentContext.get();
|
||||
|
|
@ -223,18 +236,111 @@ public final class GLContext {
|
|||
// Yes, so we don't need to do anything. Our caps and function pointers are still valid.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Ok, now it's the current context.
|
||||
loadOpenGLLibrary();
|
||||
GL11.initNativeStubs();
|
||||
loadStubs();
|
||||
currentContext = new WeakReference(context);
|
||||
HashSet exts = new HashSet();
|
||||
init(exts);
|
||||
determineAvailableExtensions(exts);
|
||||
VBOTracker.setCurrent(currentContext);
|
||||
}
|
||||
|
||||
private static void getExtensionClassesAndNames(Map exts, Set exts_names) {
|
||||
String version_string = GL11.glGetString(GL11.GL_VERSION);
|
||||
int version_index = version_string.indexOf("1.");
|
||||
if (version_index != -1) {
|
||||
String version = version_string.substring(version_index);
|
||||
char minor_version = version_string.charAt(2);
|
||||
switch (minor_version) {
|
||||
case '5':
|
||||
addExtensionClass(exts, exts_names, "GL15", "OpenGL15");
|
||||
// Fall through
|
||||
case '4':
|
||||
addExtensionClass(exts, exts_names, "GL14", "OpenGL14");
|
||||
// Fall through
|
||||
case '3':
|
||||
addExtensionClass(exts, exts_names, "GL13", "OpenGL13");
|
||||
// Fall through
|
||||
case '2':
|
||||
addExtensionClass(exts, exts_names, "GL12", "OpenGL12");
|
||||
// Fall through
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS);
|
||||
StringTokenizer tokenizer = new StringTokenizer(extensions_string);
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
String extension_string = tokenizer.nextToken();
|
||||
StringBuffer converted_name = new StringBuffer();
|
||||
int gl_prefix_index = extension_string.indexOf("GL_");
|
||||
if (gl_prefix_index == -1)
|
||||
continue;
|
||||
for (int i = gl_prefix_index + 3; i < extension_string.length(); i++) {
|
||||
char c;
|
||||
if (extension_string.charAt(i) == '_') {
|
||||
i++;
|
||||
c = Character.toUpperCase(extension_string.charAt(i));
|
||||
} else
|
||||
c = extension_string.charAt(i);
|
||||
converted_name.append(c);
|
||||
}
|
||||
addExtensionClass(exts, exts_names, converted_name.toString(), extension_string);
|
||||
}
|
||||
addExtensionClass(exts, exts_names, "ARBBufferObject", null);
|
||||
addExtensionClass(exts, exts_names, "ARBProgram", null);
|
||||
addExtensionClass(exts, exts_names, "NVProgram", null);
|
||||
}
|
||||
|
||||
private static void addExtensionClass(Map exts, Set exts_names, String ext_class_name, String ext_name) {
|
||||
if (ext_name != null)
|
||||
exts_names.add(ext_name);
|
||||
try {
|
||||
Class extension_class = Class.forName("org.lwjgl.opengl." + ext_class_name);
|
||||
extension_class.getDeclaredMethod("initNativeStubs", null); // check for existance of initNativeStubs method
|
||||
exts.put(extension_class, ext_name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// ignore
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadStubs() {
|
||||
exts = new HashMap();
|
||||
Set exts_names = new HashSet();
|
||||
getExtensionClassesAndNames(exts, exts_names);
|
||||
Iterator exts_it = exts.keySet().iterator();
|
||||
while (exts_it.hasNext()) {
|
||||
Class extension_class = (Class)exts_it.next();
|
||||
resetNativeStubs(extension_class);
|
||||
try {
|
||||
Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null);
|
||||
init_stubs_method.invoke(null, null);
|
||||
String ext_name = (String)exts.get(extension_class);
|
||||
} catch (Exception e) {
|
||||
Sys.log("Failed to initialize extension " + extension_class);
|
||||
exts_it.remove();
|
||||
exts_names.remove(exts.get(extension_class));
|
||||
}
|
||||
}
|
||||
determineAvailableExtensions(exts_names);
|
||||
}
|
||||
|
||||
private static void unloadStubs() {
|
||||
Iterator exts_it = exts.keySet().iterator();
|
||||
while (exts_it.hasNext())
|
||||
resetNativeStubs((Class)exts_it.next());
|
||||
}
|
||||
|
||||
/**
|
||||
* Native method to initialize a context
|
||||
* @param exts An empty Set of Strings that will be filled with the names of enabled extensions
|
||||
* Native method to load the OpenGL library
|
||||
*/
|
||||
private static native void init(Set exts);
|
||||
private static native void loadOpenGLLibrary();
|
||||
|
||||
/**
|
||||
* Native method to clear native stub bindings
|
||||
*/
|
||||
private static native void resetNativeStubs(Class clazz);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ public final class NVEvaluators {
|
|||
public static final int GL_MAX_MAP_TESSELLATION_NV = 0x86D6;
|
||||
public static final int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glGetMapControlPointsNV(int target, int index, int type, int ustride, int vstride, boolean packed, FloatBuffer pPoints) {
|
||||
// TODO:Check buffer size
|
||||
nglGetMapControlPointsNV(target, index, type, ustride, vstride, packed, pPoints, pPoints.position()<<2);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public final class NVFence {
|
|||
public static final int GL_FENCE_STATUS_NV = 0x84F3;
|
||||
public static final int GL_FENCE_CONDITION_NV = 0x84F4;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glGenFencesNV(IntBuffer piFences) {
|
||||
nglGenFencesNV(piFences.remaining(), piFences, piFences.position());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ public final class NVFragmentProgram extends NVProgram {
|
|||
public static final int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873;
|
||||
public static final int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
|
||||
public static void glProgramNamedParameter4fNV(int id, ByteBuffer name, float x, float y, float z, float w) {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ public final class NVHalfFloat {
|
|||
*/
|
||||
public static final int GL_HALF_FLOAT_NV = 0x140B;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glVertex2hNV(short x, short y);
|
||||
|
||||
public static native void glVertex3hNV(short x, short y, short z);
|
||||
|
|
@ -120,4 +122,4 @@ public final class NVHalfFloat {
|
|||
int attribsOffset);
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public final class NVOcclusionQuery {
|
|||
public static final int GL_PIXEL_COUNT_NV = 0x8866;
|
||||
public static final int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glGenOcclusionQueriesNV(IntBuffer piIDs) {
|
||||
nglGenOcclusionQueriesNV(piIDs.remaining(), piIDs, piIDs.position());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public final class NVPixelDataRange {
|
|||
public static final int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C;
|
||||
public static final int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glPixelDataRangeNV(int target, ByteBuffer data) {
|
||||
nglPixelDataRangeNV(target, data.remaining(), data, data.position());
|
||||
|
|
@ -83,4 +85,4 @@ public final class NVPixelDataRange {
|
|||
|
||||
public static native void glFlushPixelDataRangeNV(int target);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public final class NVPointSprite {
|
|||
public static final int GL_COORD_REPLACE_NV = 0x8862;
|
||||
public static final int GL_POINT_SPRITE_R_MODE_NV = 0x8863;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glPointParameteriNV(int pname, int param);
|
||||
|
||||
public static void glPointParameterNV(int pname, IntBuffer piParams) {
|
||||
|
|
|
|||
|
|
@ -47,8 +47,10 @@ public final class NVPrimitiveRestart {
|
|||
*/
|
||||
public static final int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glPrimitiveRestartNV();
|
||||
|
||||
public static native void glPrimitiveRestartIndexNV(int index);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public class NVProgram {
|
|||
*/
|
||||
public static final int GL_PROGRAM_ERROR_STRING_NV = 0x8874;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
// ---------------------------
|
||||
public static void glLoadProgramNV(int target, int programID, ByteBuffer string) {
|
||||
nglLoadProgramNV(target, programID, string.remaining(), string, string.position());
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ public final class NVRegisterCombiners {
|
|||
public static final int GL_COLOR_SUM_CLAMP_NV = 0x854F;
|
||||
public static final int GL_MAX_GENERAL_COMBINERS_NV = 0x854D;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static native void glCombinerParameterfNV(int pname, float param);
|
||||
|
||||
public static void glCombinerParameterNV(int pname, FloatBuffer pfParams) {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ public final class NVRegisterCombiners2
|
|||
{
|
||||
public static final int GL_PER_STAGE_CONSTANTS_NV = 0x8535;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glCombinerStageParameterNV(int stage, int pname, FloatBuffer pfParams) {
|
||||
BufferChecks.checkBuffer(pfParams);
|
||||
nglCombinerStageParameterfvNV(stage, pname, pfParams, pfParams.position());
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public final class NVVertexArrayRange {
|
|||
public static final int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520;
|
||||
public static final int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521;
|
||||
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glVertexArrayRangeNV(ByteBuffer pPointer) {
|
||||
nglVertexArrayRangeNV(pPointer.remaining(), pPointer, pPointer.position());
|
||||
}
|
||||
|
|
@ -55,8 +57,6 @@ public final class NVVertexArrayRange {
|
|||
|
||||
private static native void glXFreeMemoryNV(ByteBuffer pointer);
|
||||
|
||||
// #ifdef _WIN32
|
||||
|
||||
public static native ByteBuffer wglAllocateMemoryNV(
|
||||
int size,
|
||||
float readFrequency,
|
||||
|
|
|
|||
|
|
@ -40,467 +40,469 @@ import java.nio.ShortBuffer;
|
|||
|
||||
public final class NVVertexProgram extends NVProgram {
|
||||
|
||||
/*
|
||||
Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
|
||||
and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
and GetDoublev, and by the <target> parameter of BindProgramNV,
|
||||
ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
|
||||
LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
|
||||
and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
and GetDoublev, and by the <target> parameter of BindProgramNV,
|
||||
ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
|
||||
LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_NV = 0x8620;
|
||||
public static final int GL_VERTEX_PROGRAM_NV = 0x8620;
|
||||
|
||||
/*
|
||||
Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
|
||||
and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
and GetDoublev:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
|
||||
and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
|
||||
and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
|
||||
public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
|
||||
public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
|
||||
|
||||
/*
|
||||
Accepted by the <target> parameter of ExecuteProgramNV and
|
||||
LoadProgramNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <target> parameter of ExecuteProgramNV and
|
||||
LoadProgramNV:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
|
||||
public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
|
||||
*/
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
|
||||
public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
|
||||
public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
|
||||
public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
|
||||
|
||||
public static final int GL_CURRENT_ATTRIB_NV = 0x8626;
|
||||
public static final int GL_CURRENT_ATTRIB_NV = 0x8626;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetProgramParameterfvNV
|
||||
and GetProgramParameterdvNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetProgramParameterfvNV
|
||||
and GetProgramParameterdvNV:
|
||||
*/
|
||||
|
||||
public static final int GL_PROGRAM_PARAMETER_NV = 0x8644;
|
||||
public static final int GL_PROGRAM_PARAMETER_NV = 0x8644;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttribPointervNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetVertexAttribPointervNV:
|
||||
*/
|
||||
|
||||
public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
|
||||
public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetTrackMatrixivNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetTrackMatrixivNV:
|
||||
*/
|
||||
|
||||
public static final int GL_TRACK_MATRIX_NV = 0x8648;
|
||||
public static final int GL_TRACK_MATRIX_NV = 0x8648;
|
||||
|
||||
public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
|
||||
public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
|
||||
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
|
||||
public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
|
||||
|
||||
public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F;
|
||||
public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F;
|
||||
|
||||
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
|
||||
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
|
||||
|
||||
public static final int GL_CURRENT_MATRIX_NV = 0x8641;
|
||||
public static final int GL_CURRENT_MATRIX_NV = 0x8641;
|
||||
|
||||
public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
|
||||
public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
|
||||
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629;
|
||||
public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629;
|
||||
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV and by the
|
||||
<mode> parameter of MatrixMode:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <matrix> parameter of TrackMatrixNV and by the
|
||||
<mode> parameter of MatrixMode:
|
||||
*/
|
||||
|
||||
public static final int GL_MATRIX0_NV = 0x8630;
|
||||
public static final int GL_MATRIX0_NV = 0x8630;
|
||||
|
||||
public static final int GL_MATRIX1_NV = 0x8631;
|
||||
public static final int GL_MATRIX1_NV = 0x8631;
|
||||
|
||||
public static final int GL_MATRIX2_NV = 0x8632;
|
||||
public static final int GL_MATRIX2_NV = 0x8632;
|
||||
|
||||
public static final int GL_MATRIX3_NV = 0x8633;
|
||||
public static final int GL_MATRIX3_NV = 0x8633;
|
||||
|
||||
public static final int GL_MATRIX4_NV = 0x8634;
|
||||
public static final int GL_MATRIX4_NV = 0x8634;
|
||||
|
||||
public static final int GL_MATRIX5_NV = 0x8635;
|
||||
public static final int GL_MATRIX5_NV = 0x8635;
|
||||
|
||||
public static final int GL_MATRIX6_NV = 0x8636;
|
||||
public static final int GL_MATRIX6_NV = 0x8636;
|
||||
|
||||
public static final int GL_MATRIX7_NV = 0x8637;
|
||||
public static final int GL_MATRIX7_NV = 0x8637;
|
||||
|
||||
/*
|
||||
Accepted by the <transform> parameter of TrackMatrixNV:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <transform> parameter of TrackMatrixNV:
|
||||
*/
|
||||
|
||||
public static final int GL_IDENTITY_NV = 0x862A;
|
||||
public static final int GL_IDENTITY_NV = 0x862A;
|
||||
|
||||
public static final int GL_INVERSE_NV = 0x862B;
|
||||
public static final int GL_INVERSE_NV = 0x862B;
|
||||
|
||||
public static final int GL_TRANSPOSE_NV = 0x862C;
|
||||
public static final int GL_TRANSPOSE_NV = 0x862C;
|
||||
|
||||
public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D;
|
||||
public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D;
|
||||
|
||||
/*
|
||||
Accepted by the <array> parameter of EnableClientState and
|
||||
DisableClientState, by the <cap> parameter of IsEnabled, and by
|
||||
the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
|
||||
GetDoublev:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <array> parameter of EnableClientState and
|
||||
DisableClientState, by the <cap> parameter of IsEnabled, and by
|
||||
the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
|
||||
GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
|
||||
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
|
||||
public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
|
||||
|
||||
/*
|
||||
Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
|
||||
Map1d and Map1f and by the <cap> parameter of Enable, Disable, and
|
||||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
|
||||
Map1d and Map1f and by the <cap> parameter of Enable, Disable, and
|
||||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
|
||||
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
|
||||
public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
|
||||
|
||||
/*
|
||||
Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
|
||||
Map2d and Map2f and by the <cap> parameter of Enable, Disable, and
|
||||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
/*
|
||||
Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
|
||||
Map2d and Map2f and by the <cap> parameter of Enable, Disable, and
|
||||
IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
|
||||
GetFloatv, and GetDoublev:
|
||||
*/
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
|
||||
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
|
||||
public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
|
||||
|
||||
// ---------------------------
|
||||
static native void initNativeStubs();
|
||||
|
||||
public static void glExecuteProgramNV(int target, int id, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglExecuteProgramNV(target, id, params, params.position());
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
public static void glExecuteProgramNV(int target, int id, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglExecuteProgramNV(target, id, params, params.position());
|
||||
|
||||
private static native void nglExecuteProgramNV(int target, int id, FloatBuffer params, int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglExecuteProgramNV(int target, int id, FloatBuffer params, int paramsOffset);
|
||||
|
||||
// ---------------------------
|
||||
// ---------------------------
|
||||
|
||||
public static void glGetProgramParameterNV(int target, int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetProgramParameterfvNV(target, index, parameterName, params, params.position());
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
public static void glGetProgramParameterNV(int target, int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetProgramParameterfvNV(target, index, parameterName, params, params.position());
|
||||
|
||||
private static native void nglGetProgramParameterfvNV(
|
||||
int target,
|
||||
int index,
|
||||
int parameterName,
|
||||
FloatBuffer params,
|
||||
int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglGetProgramParameterfvNV(
|
||||
int target,
|
||||
int index,
|
||||
int parameterName,
|
||||
FloatBuffer params,
|
||||
int paramsOffset);
|
||||
|
||||
// ---------------------------
|
||||
// ---------------------------
|
||||
|
||||
public static void glGetTrackMatrixNV(int target, int address, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetTrackMatrixivNV(target, address, parameterName, params, params.position());
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
public static void glGetTrackMatrixNV(int target, int address, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetTrackMatrixivNV(target, address, parameterName, params, params.position());
|
||||
|
||||
private static native void nglGetTrackMatrixivNV(
|
||||
int target,
|
||||
int address,
|
||||
int parameterName,
|
||||
IntBuffer params,
|
||||
int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglGetTrackMatrixivNV(
|
||||
int target,
|
||||
int address,
|
||||
int parameterName,
|
||||
IntBuffer params,
|
||||
int paramsOffset);
|
||||
|
||||
// ---------------------------
|
||||
// ---------------------------
|
||||
|
||||
public static void glGetVertexAttribNV(int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribfvNV(index, parameterName, params, params.position());
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
public static void glGetVertexAttribNV(int index, int parameterName, FloatBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribfvNV(index, parameterName, params, params.position());
|
||||
|
||||
private static native void nglGetVertexAttribfvNV(int index, int parameterName, FloatBuffer params, int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglGetVertexAttribfvNV(int index, int parameterName, FloatBuffer params, int paramsOffset);
|
||||
|
||||
// ---------------------------
|
||||
// ---------------------------
|
||||
|
||||
public static void glGetVertexAttribNV(int index, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribivNV(index, parameterName, params, params.position());
|
||||
// ---------------------------
|
||||
|
||||
}
|
||||
public static void glGetVertexAttribNV(int index, int parameterName, IntBuffer params) {
|
||||
BufferChecks.checkBuffer(params);
|
||||
nglGetVertexAttribivNV(index, parameterName, params, params.position());
|
||||
|
||||
private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglGetVertexAttribivNV(int index, int parameterName, IntBuffer params, int paramsOffset);
|
||||
|
||||
public static native ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, int size);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w);
|
||||
public static native ByteBuffer glGetVertexAttribPointerNV(int index, int parameterName, int size);
|
||||
|
||||
// ---------------------------
|
||||
public static native void glProgramParameter4fNV(int target, int index, float x, float y, float z, float w);
|
||||
|
||||
public static void glProgramParameters4NV(int target, int index, int count, FloatBuffer params) {
|
||||
// ---------------------------
|
||||
|
||||
// Special case buffer check
|
||||
if (params.remaining() < count * 4) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
public static void glProgramParameters4NV(int target, int index, int count, FloatBuffer params) {
|
||||
|
||||
nglProgramParameters4fvNV(target, index, count, params, params.position());
|
||||
// Special case buffer check
|
||||
if (params.remaining() < count * 4) {
|
||||
throw new BufferOverflowException();
|
||||
}
|
||||
|
||||
}
|
||||
nglProgramParameters4fvNV(target, index, count, params, params.position());
|
||||
|
||||
private static native void nglProgramParameters4fvNV(
|
||||
int target,
|
||||
int index,
|
||||
int count,
|
||||
FloatBuffer params,
|
||||
int paramsOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglProgramParameters4fvNV(
|
||||
int target,
|
||||
int index,
|
||||
int count,
|
||||
FloatBuffer params,
|
||||
int paramsOffset);
|
||||
|
||||
public static native void glTrackMatrixNV(int target, int address, int matrix, int transform);
|
||||
// ---------------------------
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) {
|
||||
public static native void glTrackMatrixNV(int target, int address, int matrix, int transform);
|
||||
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ByteBuffer buffer) {
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position());
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
}
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position());
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) {
|
||||
}
|
||||
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, ShortBuffer buffer) {
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position() << 1);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
}
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position() << 1);
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) {
|
||||
}
|
||||
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
public static void glVertexAttribPointerNV(int index, int size, int stride, FloatBuffer buffer) {
|
||||
|
||||
nglVertexAttribPointerNV(index, size, GL11.GL_FLOAT, stride, buffer, buffer.position() << 2);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
}
|
||||
nglVertexAttribPointerNV(index, size, GL11.GL_FLOAT, stride, buffer, buffer.position() << 2);
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer buffer) {
|
||||
}
|
||||
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
public static void glVertexAttribPointerNV(int index, int size, boolean unsigned, int stride, IntBuffer buffer) {
|
||||
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position() << 2);
|
||||
BufferChecks.ensureArrayVBOdisabled();
|
||||
|
||||
}
|
||||
nglVertexAttribPointerNV(
|
||||
index,
|
||||
size,
|
||||
unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT,
|
||||
stride,
|
||||
buffer,
|
||||
buffer.position() << 2);
|
||||
|
||||
private static native void nglVertexAttribPointerNV(
|
||||
int index,
|
||||
int size,
|
||||
int type,
|
||||
int stride,
|
||||
Buffer buffer,
|
||||
int bufferOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglVertexAttribPointerNV(
|
||||
int index,
|
||||
int size,
|
||||
int type,
|
||||
int stride,
|
||||
Buffer buffer,
|
||||
int bufferOffset);
|
||||
|
||||
public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) {
|
||||
// ---------------------------
|
||||
|
||||
BufferChecks.ensureArrayVBOenabled();
|
||||
public static void glVertexAttribPointerNV(int index, int size, int type, int stride, int bufferOffset) {
|
||||
|
||||
nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset);
|
||||
BufferChecks.ensureArrayVBOenabled();
|
||||
|
||||
}
|
||||
nglVertexAttribPointerNVVBO(index, size, type, stride, bufferOffset);
|
||||
|
||||
private static native void nglVertexAttribPointerNVVBO(int index, int size, int type, int stride, int bufferOffset);
|
||||
}
|
||||
|
||||
// ---------------------------
|
||||
private static native void nglVertexAttribPointerNVVBO(int index, int size, int type, int stride, int bufferOffset);
|
||||
|
||||
public static native void glVertexAttrib1sNV(int index, short x);
|
||||
// ---------------------------
|
||||
|
||||
public static native void glVertexAttrib1fNV(int index, float x);
|
||||
public static native void glVertexAttrib1sNV(int index, short x);
|
||||
|
||||
public static native void glVertexAttrib2sNV(int index, short x, short y);
|
||||
public static native void glVertexAttrib1fNV(int index, float x);
|
||||
|
||||
public static native void glVertexAttrib2fNV(int index, float x, float y);
|
||||
public static native void glVertexAttrib2sNV(int index, short x, short y);
|
||||
|
||||
public static native void glVertexAttrib3sNV(int index, short x, short y, short z);
|
||||
public static native void glVertexAttrib2fNV(int index, float x, float y);
|
||||
|
||||
public static native void glVertexAttrib3fNV(int index, float x, float y, float z);
|
||||
public static native void glVertexAttrib3sNV(int index, short x, short y, short z);
|
||||
|
||||
public static native void glVertexAttrib4sNV(int index, short x, short y, short z, short w);
|
||||
public static native void glVertexAttrib3fNV(int index, float x, float y, float z);
|
||||
|
||||
public static native void glVertexAttrib4fNV(int index, float x, float y, float z, float w);
|
||||
public static native void glVertexAttrib4sNV(int index, short x, short y, short z, short w);
|
||||
|
||||
public static native void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w);
|
||||
public static native void glVertexAttrib4fNV(int index, float x, float y, float z, float w);
|
||||
|
||||
public static void glVertexAttribs1NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs1svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs1svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
public static native void glVertexAttrib4ubNV(int index, byte x, byte y, byte z, byte w);
|
||||
|
||||
public static void glVertexAttribs1NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs1fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs1fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
public static void glVertexAttribs1NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs1svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs1svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs2NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs2svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs2svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
public static void glVertexAttribs1NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs1fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs1fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs2NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs2fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs2fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
public static void glVertexAttribs2NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs2svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs2svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs3NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs3svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs3svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
public static void glVertexAttribs2NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs2fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs2fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs3NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs3fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs3fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
public static void glVertexAttribs3NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs3svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs3svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs4svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
public static void glVertexAttribs3NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs3fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs3fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs4fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
public static void glVertexAttribs4NV(int index, int n, ShortBuffer v) {
|
||||
nglVertexAttribs4svNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4svNV(int index, int n, ShortBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4uNV(int index, int n, ByteBuffer v) {
|
||||
nglVertexAttribs4ubvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4ubvNV(int index, int n, ByteBuffer v, int v_offset);
|
||||
public static void glVertexAttribs4NV(int index, int n, FloatBuffer v) {
|
||||
nglVertexAttribs4fvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4fvNV(int index, int n, FloatBuffer v, int v_offset);
|
||||
|
||||
public static void glVertexAttribs4uNV(int index, int n, ByteBuffer v) {
|
||||
nglVertexAttribs4ubvNV(index, n, v, v.position());
|
||||
}
|
||||
private static native void nglVertexAttribs4ubvNV(int index, int n, ByteBuffer v, int v_offset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,17 +207,18 @@ public final class Pbuffer {
|
|||
|
||||
/**
|
||||
* Method to make the Pbuffer context current. All subsequent OpenGL calls will go to this buffer.
|
||||
* @throws LWJGLException of the context could not be made current
|
||||
*/
|
||||
public synchronized void makeCurrent() {
|
||||
public synchronized void makeCurrent() throws LWJGLException {
|
||||
currentBuffer = this;
|
||||
nMakeCurrent(handle);
|
||||
VBOTracker.setCurrent(this);
|
||||
GLContext.useContext(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Native method to make a pbuffer current.
|
||||
*/
|
||||
private static native void nMakeCurrent(int handle);
|
||||
private static native void nMakeCurrent(int handle) throws LWJGLException;
|
||||
|
||||
/**
|
||||
* Gets the Pbuffer capabilities.
|
||||
|
|
@ -238,12 +239,17 @@ public final class Pbuffer {
|
|||
* the current rendering context or not.
|
||||
*/
|
||||
public synchronized void destroy() {
|
||||
makeCurrent();
|
||||
int error = GL11.glGetError();
|
||||
VBOTracker.remove(this);
|
||||
nDestroy(handle);
|
||||
if (error != GL11.GL_NO_ERROR)
|
||||
throw new OpenGLException(error);
|
||||
try {
|
||||
makeCurrent();
|
||||
int error = GL11.glGetError();
|
||||
nDestroy(handle);
|
||||
GLContext.useContext(null);
|
||||
if (error != GL11.GL_NO_ERROR)
|
||||
throw new OpenGLException(error);
|
||||
} catch (LWJGLException e) {
|
||||
// ignore exception
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.ByteOrder;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.opengl.PixelFormat;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.DisplayMode;
|
||||
|
|
@ -176,7 +177,11 @@ public class PbufferTest {
|
|||
pbuffer.destroy();
|
||||
initPbuffer();
|
||||
}
|
||||
pbuffer.makeCurrent();
|
||||
try {
|
||||
pbuffer.makeCurrent();
|
||||
} catch (LWJGLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
// Pbuffer rendering
|
||||
//clear background
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
||||
|
|
@ -198,7 +203,11 @@ public class PbufferTest {
|
|||
}
|
||||
GL11.glPopMatrix();
|
||||
GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0, 0, 512, 512, 0);
|
||||
Display.makeCurrent();
|
||||
try {
|
||||
Display.makeCurrent();
|
||||
} catch (LWJGLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// OpenGL window rendering
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue