From 02e0c84e0e390beaa890b186fcff75215c947424 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Thu, 3 Aug 2006 09:51:45 +0000 Subject: [PATCH] --- .../org/lwjgl/opengl/ContextCapabilities.java | 20 +++ src/generated/org/lwjgl/opengl/GL21.java | 95 ++++++++++++++ src/native/generated/org_lwjgl_opengl_GL21.c | 48 +++++++ src/templates/org/lwjgl/opengl/GL21.java | 117 ++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 src/generated/org/lwjgl/opengl/GL21.java create mode 100644 src/native/generated/org_lwjgl_opengl_GL21.c create mode 100644 src/templates/org/lwjgl/opengl/GL21.java diff --git a/src/generated/org/lwjgl/opengl/ContextCapabilities.java b/src/generated/org/lwjgl/opengl/ContextCapabilities.java index 7bc8fd58..361580a6 100644 --- a/src/generated/org/lwjgl/opengl/ContextCapabilities.java +++ b/src/generated/org/lwjgl/opengl/ContextCapabilities.java @@ -107,6 +107,7 @@ public class ContextCapabilities { public final boolean OpenGL14; public final boolean OpenGL15; public final boolean OpenGL20; + public final boolean OpenGL21; public final boolean GL_HP_occlusion_test; public final boolean GL_IBM_rasterpos_clip; public final boolean GL_NV_blend_square; @@ -874,6 +875,12 @@ public class ContextCapabilities { long GL20_glStencilFuncSeparate_pointer; long GL20_glStencilMaskSeparate_pointer; long GL20_glBlendEquationSeparate_pointer; + long GL21_glUniformMatrix2x3fv_pointer; + long GL21_glUniformMatrix3x2fv_pointer; + long GL21_glUniformMatrix2x4fv_pointer; + long GL21_glUniformMatrix4x2fv_pointer; + long GL21_glUniformMatrix3x4fv_pointer; + long GL21_glUniformMatrix4x3fv_pointer; long NV_evaluators_glGetMapControlPointsNV_pointer; long NV_evaluators_glMapControlPointsNV_pointer; long NV_evaluators_glMapParameterfvNV_pointer; @@ -1929,6 +1936,16 @@ public class ContextCapabilities { (GL20_glBlendEquationSeparate_pointer = GLContext.getFunctionAddress("glBlendEquationSeparate")) != 0; } + private boolean GL21_initNativeFunctionAddresses() { + return + (GL21_glUniformMatrix2x3fv_pointer = GLContext.getFunctionAddress("glUniformMatrix2x3fv")) != 0 && + (GL21_glUniformMatrix3x2fv_pointer = GLContext.getFunctionAddress("glUniformMatrix3x2fv")) != 0 && + (GL21_glUniformMatrix2x4fv_pointer = GLContext.getFunctionAddress("glUniformMatrix2x4fv")) != 0 && + (GL21_glUniformMatrix4x2fv_pointer = GLContext.getFunctionAddress("glUniformMatrix4x2fv")) != 0 && + (GL21_glUniformMatrix3x4fv_pointer = GLContext.getFunctionAddress("glUniformMatrix3x4fv")) != 0 && + (GL21_glUniformMatrix4x3fv_pointer = GLContext.getFunctionAddress("glUniformMatrix4x3fv")) != 0; + } + private boolean NV_evaluators_initNativeFunctionAddresses() { return (NV_evaluators_glGetMapControlPointsNV_pointer = GLContext.getFunctionAddress("glGetMapControlPointsNV")) != 0 && @@ -2225,6 +2242,8 @@ public class ContextCapabilities { supported_extensions.remove("OpenGL15"); if (supported_extensions.contains("OpenGL20") && !GL20_initNativeFunctionAddresses()) supported_extensions.remove("OpenGL20"); + if (supported_extensions.contains("OpenGL21") && !GL21_initNativeFunctionAddresses()) + supported_extensions.remove("OpenGL21"); if (supported_extensions.contains("GL_NV_evaluators") && !NV_evaluators_initNativeFunctionAddresses()) supported_extensions.remove("GL_NV_evaluators"); if (supported_extensions.contains("GL_NV_fence") && !NV_fence_initNativeFunctionAddresses()) @@ -2361,6 +2380,7 @@ public class ContextCapabilities { this.OpenGL14 = supported_extensions.contains("OpenGL14"); this.OpenGL15 = supported_extensions.contains("OpenGL15"); this.OpenGL20 = supported_extensions.contains("OpenGL20"); + this.OpenGL21 = supported_extensions.contains("OpenGL21"); this.GL_HP_occlusion_test = supported_extensions.contains("GL_HP_occlusion_test"); this.GL_IBM_rasterpos_clip = supported_extensions.contains("GL_IBM_rasterpos_clip"); this.GL_NV_blend_square = supported_extensions.contains("GL_NV_blend_square"); diff --git a/src/generated/org/lwjgl/opengl/GL21.java b/src/generated/org/lwjgl/opengl/GL21.java new file mode 100644 index 00000000..8708ea87 --- /dev/null +++ b/src/generated/org/lwjgl/opengl/GL21.java @@ -0,0 +1,95 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class GL21 { + /** + * Accepted by the <target> parameters of BindBuffer, BufferData, + * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferParameteriv, and GetBufferPointerv: + */ + public static final int GL_PIXEL_PACK_BUFFER = 0x88eb; + public static final int GL_PIXEL_UNPACK_BUFFER = 0x88ec; + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev: + */ + public static final int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ed; + public static final int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88ef; + /** + * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D, + * TexImage3D, CopyTexImage1D, CopyTexImage2D. + */ + public static final int GL_SRGB = 0x8c40; + public static final int GL_SRGB8 = 0x8c41; + public static final int GL_SRGB_ALPHA = 0x8c42; + public static final int GL_SRGB8_ALPHA8 = 0x8c43; + public static final int GL_SLUMINANCE_ALPHA = 0x8c44; + public static final int GL_SLUMINANCE8_ALPHA8 = 0x8c45; + public static final int GL_SLUMINANCE = 0x8c46; + public static final int GL_SLUMINANCE8 = 0x8c47; + public static final int GL_COMPRESSED_SRGB = 0x8c48; + public static final int GL_COMPRESSED_SRGB_ALPHA = 0x8c49; + public static final int GL_COMPRESSED_SLUMINANCE = 0x8c4a; + public static final int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8c4b; + /** + * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. + */ + public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0xffffffff; + + private GL21() { + } + + + public static void glUniformMatrix2x3(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix2x3fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix2x3fv(location, (matrices.remaining()) / (2 * 3), transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix2x3fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); + + public static void glUniformMatrix3x2(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix3x2fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix3x2fv(location, (matrices.remaining()) / (3 * 2), transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix3x2fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); + + public static void glUniformMatrix2x4(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix2x4fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix2x4fv(location, (matrices.remaining()) >> 3, transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix2x4fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); + + public static void glUniformMatrix4x2(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix4x2fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix4x2fv(location, (matrices.remaining()) >> 3, transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix4x2fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); + + public static void glUniformMatrix3x4(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix3x4fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix3x4fv(location, (matrices.remaining()) / (3 * 4), transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix3x4fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); + + public static void glUniformMatrix4x3(int location, boolean transpose, FloatBuffer matrices) { + long function_pointer = GLContext.getCapabilities().GL21_glUniformMatrix4x3fv_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); + nglUniformMatrix4x3fv(location, (matrices.remaining()) / (4 * 3), transpose, matrices, matrices.position(), function_pointer); + } + private static native void nglUniformMatrix4x3fv(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); +} diff --git a/src/native/generated/org_lwjgl_opengl_GL21.c b/src/native/generated/org_lwjgl_opengl_GL21.c new file mode 100644 index 00000000..3ccd4e71 --- /dev/null +++ b/src/native/generated/org_lwjgl_opengl_GL21.c @@ -0,0 +1,48 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include +#include "extgl.h" + +typedef void (APIENTRY *glUniformMatrix2x3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix3x2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix2x4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix4x2fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix3x4fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); +typedef void (APIENTRY *glUniformMatrix4x3fvPROC) (GLint location, GLsizei count, GLboolean transpose, GLfloat * matrices); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix2x3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix2x3fvPROC glUniformMatrix2x3fv = (glUniformMatrix2x3fvPROC)((intptr_t)function_pointer); + glUniformMatrix2x3fv(location, count, transpose, matrices_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix3x2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix3x2fvPROC glUniformMatrix3x2fv = (glUniformMatrix3x2fvPROC)((intptr_t)function_pointer); + glUniformMatrix3x2fv(location, count, transpose, matrices_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix2x4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix2x4fvPROC glUniformMatrix2x4fv = (glUniformMatrix2x4fvPROC)((intptr_t)function_pointer); + glUniformMatrix2x4fv(location, count, transpose, matrices_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix4x2fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix4x2fvPROC glUniformMatrix4x2fv = (glUniformMatrix4x2fvPROC)((intptr_t)function_pointer); + glUniformMatrix4x2fv(location, count, transpose, matrices_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix3x4fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix3x4fvPROC glUniformMatrix3x4fv = (glUniformMatrix3x4fvPROC)((intptr_t)function_pointer); + glUniformMatrix3x4fv(location, count, transpose, matrices_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21_nglUniformMatrix4x3fv(JNIEnv *env, jclass clazz, jint location, jint count, jboolean transpose, jobject matrices, jint matrices_position, jlong function_pointer) { + GLfloat *matrices_address = ((GLfloat *)(*env)->GetDirectBufferAddress(env, matrices)) + matrices_position; + glUniformMatrix4x3fvPROC glUniformMatrix4x3fv = (glUniformMatrix4x3fvPROC)((intptr_t)function_pointer); + glUniformMatrix4x3fv(location, count, transpose, matrices_address); +} + diff --git a/src/templates/org/lwjgl/opengl/GL21.java b/src/templates/org/lwjgl/opengl/GL21.java new file mode 100644 index 00000000..5c8a810b --- /dev/null +++ b/src/templates/org/lwjgl/opengl/GL21.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2002-2004 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.opengl; + +import org.lwjgl.util.generator.*; + +import java.nio.*; + +public interface GL21 { + + // ------------------------------------------------------------------ + // --------------------------[ GLSL 1.20 ]--------------------------- + // ------------------------------------------------------------------ + + @StripPostfix("matrices") + void glUniformMatrix2x3fv(int location, @AutoSize(value = "matrices", expression = " / (2 * 3)") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + @StripPostfix("matrices") + void glUniformMatrix3x2fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 2)") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + @StripPostfix("matrices") + void glUniformMatrix2x4fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + @StripPostfix("matrices") + void glUniformMatrix4x2fv(int location, @AutoSize(value = "matrices", expression = " >> 3") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + @StripPostfix("matrices") + void glUniformMatrix3x4fv(int location, @AutoSize(value = "matrices", expression = " / (3 * 4)") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + @StripPostfix("matrices") + void glUniformMatrix4x3fv(int location, @AutoSize(value = "matrices", expression = " / (4 * 3)") @GLsizei int count, + boolean transpose, FloatBuffer matrices); + + // ------------------------------------------------------------------ + // -------------------[ ARB_pixel_buffer_object ]-------------------- + // ------------------------------------------------------------------ + + /** + * Accepted by the <target> parameters of BindBuffer, BufferData, + * BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferParameteriv, and GetBufferPointerv: + */ + int GL_PIXEL_PACK_BUFFER = 0x88EB; + int GL_PIXEL_UNPACK_BUFFER = 0x88EC; + + /** + * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev: + */ + int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED; + int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + + // ------------------------------------------------------------------ + // ----------------------[ EXT_texture_sRGB ]------------------------ + // ------------------------------------------------------------------ + + /** + * Accepted by the <internalformat> parameter of TexImage1D, TexImage2D, + * TexImage3D, CopyTexImage1D, CopyTexImage2D. + */ + int GL_SRGB = 0x8C40; + int GL_SRGB8 = 0x8C41; + int GL_SRGB_ALPHA = 0x8C42; + int GL_SRGB8_ALPHA8 = 0x8C43; + int GL_SLUMINANCE_ALPHA = 0x8C44; + int GL_SLUMINANCE8_ALPHA8 = 0x8C45; + int GL_SLUMINANCE = 0x8C46; + int GL_SLUMINANCE8 = 0x8C47; + int GL_COMPRESSED_SRGB = 0x8C48; + int GL_COMPRESSED_SRGB_ALPHA = 0x8C49; + int GL_COMPRESSED_SLUMINANCE = 0x8C4A; + int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; + + // ------------------------------------------------------------------ + // -----------------------[ Misc additions ]------------------------- + // ------------------------------------------------------------------ + + /** + * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. + */ + int GL_CURRENT_RASTER_SECONDARY_COLOR = -1; // TODO: Find this value + +} \ No newline at end of file