Added missing CURRENT_RASTER_SECONDARY_COLOR enum value (GL 2.1)

Added EXT_gpu_program_parameters extension
This commit is contained in:
Ioannis Tsakpinis 2006-10-11 11:21:40 +00:00
parent ec9b449b78
commit 1b1b9c5416
6 changed files with 110 additions and 2 deletions

View File

@ -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");

View File

@ -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);
}

View File

@ -39,7 +39,7 @@ public final class GL21 {
/**
* Accepted by the &lt;pname&gt; 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() {
}

View File

@ -0,0 +1,20 @@
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#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);
}

View File

@ -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);
}

View File

@ -112,6 +112,6 @@ public interface GL21 {
/**
* Accepted by the &lt;pname&gt; parameter of GetIntegerv and GetFloatv.
*/
int GL_CURRENT_RASTER_SECONDARY_COLOR = -1; // TODO: Find this value
int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F;
}