From 1b1b9c5416001a59759a84abd8da8a09ebe2ab16 Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Wed, 11 Oct 2006 11:21:40 +0000 Subject: [PATCH] Added missing CURRENT_RASTER_SECONDARY_COLOR enum value (GL 2.1) Added EXT_gpu_program_parameters extension --- .../org/lwjgl/opengl/ContextCapabilities.java | 12 +++++ .../lwjgl/opengl/EXTGpuProgramParameters.java | 30 ++++++++++++ src/generated/org/lwjgl/opengl/GL21.java | 2 +- ...org_lwjgl_opengl_EXTGpuProgramParameters.c | 20 ++++++++ .../opengl/EXT_gpu_program_parameters.java | 46 +++++++++++++++++++ src/templates/org/lwjgl/opengl/GL21.java | 2 +- 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java create mode 100644 src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c create mode 100644 src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java diff --git a/src/generated/org/lwjgl/opengl/ContextCapabilities.java b/src/generated/org/lwjgl/opengl/ContextCapabilities.java index b8c796b6..030b3284 100644 --- a/src/generated/org/lwjgl/opengl/ContextCapabilities.java +++ b/src/generated/org/lwjgl/opengl/ContextCapabilities.java @@ -77,6 +77,7 @@ public class ContextCapabilities { public final boolean GL_EXT_framebuffer_blit; public final boolean GL_EXT_framebuffer_multisample; public final boolean GL_EXT_framebuffer_object; + public final boolean GL_EXT_gpu_program_parameters; public final boolean GL_EXT_multi_draw_arrays; public final boolean GL_EXT_packed_depth_stencil; public final boolean GL_EXT_packed_pixels; @@ -453,6 +454,8 @@ public class ContextCapabilities { long EXT_framebuffer_object_glFramebufferRenderbufferEXT_pointer; long EXT_framebuffer_object_glGetFramebufferAttachmentParameterivEXT_pointer; long EXT_framebuffer_object_glGenerateMipmapEXT_pointer; + long EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer; + long EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer; long EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer; long EXT_paletted_texture_glColorTableEXT_pointer; long EXT_paletted_texture_glColorSubTableEXT_pointer; @@ -1464,6 +1467,12 @@ public class ContextCapabilities { (EXT_framebuffer_object_glGenerateMipmapEXT_pointer = GLContext.getFunctionAddress("glGenerateMipmapEXT")) != 0; } + private boolean EXT_gpu_program_parameters_initNativeFunctionAddresses() { + return + (EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramEnvParameter4fvEXT")) != 0 && + (EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer = GLContext.getFunctionAddress("glProgramLocalParameter4fvEXT")) != 0; + } + private boolean EXT_multi_draw_arrays_initNativeFunctionAddresses() { return (EXT_multi_draw_arrays_glMultiDrawArraysEXT_pointer = GLContext.getFunctionAddress("glMultiDrawArraysEXT")) != 0; @@ -2232,6 +2241,8 @@ public class ContextCapabilities { supported_extensions.remove("GL_EXT_framebuffer_multisample"); if (supported_extensions.contains("GL_EXT_framebuffer_object") && !EXT_framebuffer_object_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_framebuffer_object"); + if (supported_extensions.contains("GL_EXT_gpu_program_parameters") && !EXT_gpu_program_parameters_initNativeFunctionAddresses()) + supported_extensions.remove("GL_EXT_gpu_program_parameters"); if (supported_extensions.contains("GL_EXT_multi_draw_arrays") && !EXT_multi_draw_arrays_initNativeFunctionAddresses()) supported_extensions.remove("GL_EXT_multi_draw_arrays"); if (supported_extensions.contains("GL_EXT_paletted_texture") && !EXT_paletted_texture_initNativeFunctionAddresses()) @@ -2367,6 +2378,7 @@ public class ContextCapabilities { this.GL_EXT_framebuffer_blit = supported_extensions.contains("GL_EXT_framebuffer_blit"); this.GL_EXT_framebuffer_multisample = supported_extensions.contains("GL_EXT_framebuffer_multisample"); this.GL_EXT_framebuffer_object = supported_extensions.contains("GL_EXT_framebuffer_object"); + this.GL_EXT_gpu_program_parameters = supported_extensions.contains("GL_EXT_gpu_program_parameters"); this.GL_EXT_multi_draw_arrays = supported_extensions.contains("GL_EXT_multi_draw_arrays"); this.GL_EXT_packed_depth_stencil = supported_extensions.contains("GL_EXT_packed_depth_stencil"); this.GL_EXT_packed_pixels = supported_extensions.contains("GL_EXT_packed_pixels"); diff --git a/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java b/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java new file mode 100644 index 00000000..60c50f3a --- /dev/null +++ b/src/generated/org/lwjgl/opengl/EXTGpuProgramParameters.java @@ -0,0 +1,30 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +package org.lwjgl.opengl; + +import org.lwjgl.LWJGLException; +import org.lwjgl.BufferChecks; +import java.nio.*; + +public final class EXTGpuProgramParameters { + + private EXTGpuProgramParameters() { + } + + + public static void glProgramEnvParameter4EXT(int target, int index, int count, FloatBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_gpu_program_parameters_glProgramEnvParameter4fvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, count << 2); + nglProgramEnvParameter4fvEXT(target, index, count, params, params.position(), function_pointer); + } + private static native void nglProgramEnvParameter4fvEXT(int target, int index, int count, FloatBuffer params, int params_position, long function_pointer); + + public static void glProgramLocalParameter4EXT(int target, int index, int count, FloatBuffer params) { + long function_pointer = GLContext.getCapabilities().EXT_gpu_program_parameters_glProgramLocalParameter4fvEXT_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, count << 2); + nglProgramLocalParameter4fvEXT(target, index, count, params, params.position(), function_pointer); + } + private static native void nglProgramLocalParameter4fvEXT(int target, int index, int count, FloatBuffer params, int params_position, long function_pointer); +} diff --git a/src/generated/org/lwjgl/opengl/GL21.java b/src/generated/org/lwjgl/opengl/GL21.java index 8708ea87..fb63f269 100644 --- a/src/generated/org/lwjgl/opengl/GL21.java +++ b/src/generated/org/lwjgl/opengl/GL21.java @@ -39,7 +39,7 @@ public final class GL21 { /** * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */ - public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0xffffffff; + public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845f; private GL21() { } diff --git a/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c b/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c new file mode 100644 index 00000000..b1627705 --- /dev/null +++ b/src/native/generated/org_lwjgl_opengl_EXTGpuProgramParameters.c @@ -0,0 +1,20 @@ +/* MACHINE GENERATED FILE, DO NOT EDIT */ + +#include +#include "extgl.h" + +typedef void (APIENTRY *glProgramEnvParameter4fvEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); +typedef void (APIENTRY *glProgramLocalParameter4fvEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat * params); + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGpuProgramParameters_nglProgramEnvParameter4fvEXT(JNIEnv *env, jclass clazz, jint target, jint index, jint count, jobject params, jint params_position, jlong function_pointer) { + const GLfloat *params_address = ((const GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glProgramEnvParameter4fvEXTPROC glProgramEnvParameter4fvEXT = (glProgramEnvParameter4fvEXTPROC)((intptr_t)function_pointer); + glProgramEnvParameter4fvEXT(target, index, count, params_address); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGpuProgramParameters_nglProgramLocalParameter4fvEXT(JNIEnv *env, jclass clazz, jint target, jint index, jint count, jobject params, jint params_position, jlong function_pointer) { + const GLfloat *params_address = ((const GLfloat *)(*env)->GetDirectBufferAddress(env, params)) + params_position; + glProgramLocalParameter4fvEXTPROC glProgramLocalParameter4fvEXT = (glProgramLocalParameter4fvEXTPROC)((intptr_t)function_pointer); + glProgramLocalParameter4fvEXT(target, index, count, params_address); +} + diff --git a/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java b/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java new file mode 100644 index 00000000..e2f5d722 --- /dev/null +++ b/src/templates/org/lwjgl/opengl/EXT_gpu_program_parameters.java @@ -0,0 +1,46 @@ +/* + * 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 EXT_gpu_program_parameters { + + @StripPostfix("params") + void glProgramEnvParameter4fvEXT(@GLenum int target, @GLuint int index, @GLsizei int count, @Check("count << 2") @Const FloatBuffer params); + + @StripPostfix("params") + void glProgramLocalParameter4fvEXT(@GLenum int target, @GLuint int index, @GLsizei int count, @Check("count << 2") @Const FloatBuffer params); + +} \ No newline at end of file diff --git a/src/templates/org/lwjgl/opengl/GL21.java b/src/templates/org/lwjgl/opengl/GL21.java index 5c8a810b..b6d57b30 100644 --- a/src/templates/org/lwjgl/opengl/GL21.java +++ b/src/templates/org/lwjgl/opengl/GL21.java @@ -112,6 +112,6 @@ public interface GL21 { /** * Accepted by the <pname> parameter of GetIntegerv and GetFloatv. */ - int GL_CURRENT_RASTER_SECONDARY_COLOR = -1; // TODO: Find this value + int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F; } \ No newline at end of file