From b00c24ef761b6197a3c60131718d9803a4cc676d Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 23 Oct 2003 07:18:07 +0000 Subject: [PATCH] Fixed ARBFragmentProgram and ARB_vbo --- src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java | 2 ++ src/java/org/lwjgl/test/opengl/PbufferTest.java | 2 +- src/native/common/org_lwjgl_opengl_GL.cpp | 4 ++-- src/native/linux/org_lwjgl_Display.cpp | 1 + src/native/win32/org_lwjgl_Display.cpp | 8 ++------ 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java b/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java index 2c3d4d68..21aa5a08 100644 --- a/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java +++ b/src/java/org/lwjgl/opengl/arb/ARBFragmentProgram.java @@ -41,6 +41,8 @@ package org.lwjgl.opengl.arb; public interface ARBFragmentProgram { + public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804; + public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; public static final int GL_PROGRAM_LENGTH_ARB = 0x8627; public static final int GL_PROGRAM_FORMAT_ARB = 0x8876; public static final int GL_PROGRAM_BINDING_ARB = 0x8677; diff --git a/src/java/org/lwjgl/test/opengl/PbufferTest.java b/src/java/org/lwjgl/test/opengl/PbufferTest.java index ed116880..72d2ac31 100644 --- a/src/java/org/lwjgl/test/opengl/PbufferTest.java +++ b/src/java/org/lwjgl/test/opengl/PbufferTest.java @@ -202,7 +202,7 @@ public class PbufferTest { GL.glEnd(); } GL.glPopMatrix(); - GL.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, 0, 0, 512, 512, 0); + GL.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_COMPRESSED_RGB, 0, 0, 512, 512, 0); Pbuffer.releaseContext(); // OpenGL window rendering diff --git a/src/native/common/org_lwjgl_opengl_GL.cpp b/src/native/common/org_lwjgl_opengl_GL.cpp index 46dae062..7b2d1085 100644 --- a/src/native/common/org_lwjgl_opengl_GL.cpp +++ b/src/native/common/org_lwjgl_opengl_GL.cpp @@ -3653,8 +3653,8 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL_glIsBufferARB(JNIEnv *env, j JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL_nglBufferDataARB(JNIEnv *env, jclass clazz, jint target, jint size, jobject buffer, jint usage, jint buffer_offset) { CHECK_EXISTS(glBufferDataARB) - const GLvoid *address = (const GLvoid *)safeGetBufferAddress(env, buffer); - glBufferDataARB((GLenum)target, (GLsizeiptrARB)size, address, (GLenum)usage + buffer_offset); + const GLbyte *address = (const GLbyte *)safeGetBufferAddress(env, buffer); + glBufferDataARB((GLenum)target, (GLsizeiptrARB)size, address + buffer_offset, (GLenum)usage); CHECK_GL_ERROR } diff --git a/src/native/linux/org_lwjgl_Display.cpp b/src/native/linux/org_lwjgl_Display.cpp index 72828e18..f78f6b18 100644 --- a/src/native/linux/org_lwjgl_Display.cpp +++ b/src/native/linux/org_lwjgl_Display.cpp @@ -48,6 +48,7 @@ #include #include #include "org_lwjgl_Display.h" +#include "common_tools.h" static int saved_width; static int saved_height; diff --git a/src/native/win32/org_lwjgl_Display.cpp b/src/native/win32/org_lwjgl_Display.cpp index 2fcde374..9ff4304d 100644 --- a/src/native/win32/org_lwjgl_Display.cpp +++ b/src/native/win32/org_lwjgl_Display.cpp @@ -405,12 +405,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Display_setGammaRamp currentGamma[i + 512] = rampEntry; } HDC screenDC = GetDC(NULL); - try { - if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { - throwException(env, "Failed to set device gamma.") - } - } catch (...) { - throwException(env, "Exception occurred in SetDeviceGammaRamp.") + if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { + throwException(env, "Failed to set device gamma."); } ReleaseDC(NULL, screenDC); }