You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
|
|
2
|
3
(2) |
4
|
5
|
6
(8) |
7
|
8
|
|
9
(8) |
10
(7) |
11
(11) |
12
(7) |
13
(8) |
14
(8) |
15
(5) |
|
16
(3) |
17
|
18
(51) |
19
(9) |
20
(6) |
21
(3) |
22
(3) |
|
23
(2) |
24
|
25
(17) |
26
(1) |
27
(4) |
28
(5) |
29
(4) |
|
30
(1) |
31
(1) |
|
|
|
|
|
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/native/win32 Modified Files: org_lwjgl_input_Cursor.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_Pbuffer.c Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: org_lwjgl_opengl_Pbuffer.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_Pbuffer.c 14 Jan 2005 13:56:51 -0000 1.4 +++ org_lwjgl_opengl_Pbuffer.c 18 Jan 2005 12:34:36 -0000 1.5 @@ -55,7 +55,7 @@ HDC Pbuffer_dc; } PbufferInfo; -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getPbufferCaps +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getPbufferCapabilities (JNIEnv *env, jobject self) { int caps = 0; Index: org_lwjgl_input_Cursor.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Cursor.c 9 Dec 2004 15:36:13 -0000 1.1 +++ org_lwjgl_input_Cursor.c 18 Jan 2005 12:34:35 -0000 1.2 @@ -44,6 +44,19 @@ #include "org_lwjgl_opengl_Win32Display.h" #include "common_tools.h" +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getMaxCursorSize + (JNIEnv *env, jobject self) +{ + return GetSystemMetrics(SM_CXCURSOR); +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getMinCursorSize + (JNIEnv *env, jobject self) +{ + return GetSystemMetrics(SM_CXCURSOR); +} + + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_nCreateCursor (JNIEnv *env, jobject self, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_input_Mouse.c 10 Jan 2005 09:21:35 -0000 1.8 +++ org_lwjgl_input_Mouse.c 18 Jan 2005 12:34:36 -0000 1.9 @@ -334,12 +334,6 @@ return copyEvents(&event_queue, buffer_ptr, buffer_size); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getNativeCursorCaps - (JNIEnv *env, jobject self) -{ - return org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARENCY; -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_setNativeCursor (JNIEnv *env, jobject self, jobject handle_buffer) { @@ -356,18 +350,6 @@ } } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getMaxCursorSize - (JNIEnv *env, jobject self) -{ - return GetSystemMetrics(SM_CXCURSOR); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_getMinCursorSize - (JNIEnv *env, jobject self) -{ - return GetSystemMetrics(SM_CXCURSOR); -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_destroyMouse(JNIEnv *env, jobject self) { ShutdownMouse(); } |
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/pbuffers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/java/org/lwjgl/test/opengl/pbuffers Modified Files: PbufferTest.java Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PbufferTest.java 5 Sep 2004 08:38:53 -0000 1.2 +++ PbufferTest.java 18 Jan 2005 12:34:34 -0000 1.3 @@ -114,7 +114,7 @@ glInit(); - if ( (Pbuffer.getPbufferCaps() & Pbuffer.PBUFFER_SUPPORTED) == 0 ) { + if ( (Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0 ) { System.out.println("No Pbuffer support!"); System.exit(-1); } |
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/java/org/lwjgl/test/opengl Modified Files: PbufferTest.java Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/PbufferTest.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- PbufferTest.java 11 Jan 2005 13:53:10 -0000 1.40 +++ PbufferTest.java 18 Jan 2005 12:34:34 -0000 1.41 @@ -102,7 +102,7 @@ // start of in windowed mode Display.create(); // gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); - if ((Pbuffer.getPbufferCaps() & Pbuffer.PBUFFER_SUPPORTED) == 0) { + if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) { System.out.println("No Pbuffer support!"); System.exit(1); } |
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/java/org/lwjgl/opengl Modified Files: DisplayImplementation.java LinuxDisplay.java MacOSXDisplay.java Pbuffer.java Win32Display.java Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Win32Display.java 11 Jan 2005 13:53:09 -0000 1.7 +++ Win32Display.java 18 Jan 2005 12:34:33 -0000 1.8 @@ -44,6 +44,7 @@ import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; +import org.lwjgl.input.Cursor; final class Win32Display implements DisplayImplementation { private static final int CURSOR_HANDLE_SIZE = 8; @@ -81,7 +82,10 @@ public native void enableMouseBuffer() throws LWJGLException; public native int readMouse(IntBuffer buffer, int buffer_position); public native void grabMouse(boolean grab); - public native int getNativeCursorCaps(); + public int getNativeCursorCapabilities() { + return Cursor.CURSOR_ONE_BIT_TRANSPARENCY; + } + public native void setNativeCursor(Object handle) throws LWJGLException; public native int getMinCursorSize(); public native int getMaxCursorSize(); @@ -104,7 +108,7 @@ } public native void destroyCursor(Object cursorHandle); - public native int getPbufferCaps(); + public native int getPbufferCapabilities(); public native boolean isBufferLost(ByteBuffer handle); public native void makePbufferCurrent(ByteBuffer handle) throws LWJGLException; Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Pbuffer.java 18 Jan 2005 11:58:33 -0000 1.34 +++ Pbuffer.java 18 Jan 2005 12:34:33 -0000 1.35 @@ -175,7 +175,7 @@ * with the Display context (if created). */ public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Pbuffer shared_context) throws LWJGLException { - if ((getPbufferCaps() & PBUFFER_SUPPORTED) == 0) + if ((getCapabilities() & PBUFFER_SUPPORTED) == 0) throw new IllegalStateException("Pbuffers are not supported"); this.width = width; this.height = height; @@ -223,8 +223,8 @@ * * @return a bitmask of Pbuffer capabilities. */ - public static int getPbufferCaps() { - return Display.getImplementation().getPbufferCaps(); + public static int getCapabilities() { + return Display.getImplementation().getPbufferCapabilities(); } /** Index: DisplayImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DisplayImplementation.java 11 Jan 2005 13:53:09 -0000 1.6 +++ DisplayImplementation.java 18 Jan 2005 12:34:33 -0000 1.7 @@ -66,7 +66,7 @@ int getGammaRampLength(); /** - * Native method to set the gamma ramp. + * Method to set the gamma ramp. */ void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException; @@ -90,7 +90,7 @@ DisplayMode init(); /** - * Native implementation of setTitle(). This will read the window's title member + * Implementation of setTitle(). This will read the window's title member * and stash it in the native title of the window. */ void setTitle(String title); @@ -131,41 +131,41 @@ void reshape(int x, int y, int width, int height); /** - * Native method for getting displaymodes + * Method for getting displaymodes */ DisplayMode[] getAvailableDisplayModes(); /* * Mouse methods */ - /** Native query of wheel support */ + /** Query of wheel support */ boolean hasWheel(); - /** Native query of button count */ + /** Query of button count */ int getButtonCount(); /** - * Native method to create the mouse. + * Method to create the mouse. */ void createMouse(); /** - * Native method the destroy the mouse + * Method the destroy the mouse */ void destroyMouse(); /** - * Native method to poll the mouse + * Method to poll the mouse */ void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons); /** - * Native method to enable the buffer + * Method to enable the buffer */ void enableMouseBuffer() throws LWJGLException; /** - * Native method to read the keyboard buffer + * Method to read the keyboard buffer * * @return the total number of events read. */ @@ -175,17 +175,17 @@ void grabMouse(boolean grab); /** - * Native function to determine native cursor support + * Function to determine native cursor support */ - int getNativeCursorCaps(); + int getNativeCursorCapabilities(); - /** Native method to set the native cursor */ + /** Method to set the native cursor */ void setNativeCursor(Object handle) throws LWJGLException; - /** Native method returning the minimum cursor size */ + /** Method returning the minimum cursor size */ int getMinCursorSize(); - /** Native method returning the maximum cursor size */ + /** Method returning the maximum cursor size */ int getMaxCursorSize(); /* @@ -193,17 +193,17 @@ */ /** - * Native method to create the keyboard + * Method to create the keyboard */ void createKeyboard() throws LWJGLException; /** - * Native method to destroy the keyboard + * Method to destroy the keyboard */ void destroyKeyboard(); /** - * Native method to poll the keyboard. + * Method to poll the keyboard. * * @param keyDownBuffer the address of a 256-byte buffer to place * key states in. @@ -211,18 +211,18 @@ void pollKeyboard(ByteBuffer keyDownBuffer); /** - * Native method to read the keyboard buffer + * Method to read the keyboard buffer * @return the total number of events read. */ int readKeyboard(IntBuffer buffer, int buffer_position); /** - * Native method to enable the translation buffer + * Method to enable the translation buffer */ void enableTranslation() throws LWJGLException; /** - * Native method to enable the buffer + * Method to enable the buffer */ void enableKeyboardBuffer() throws LWJGLException; @@ -234,7 +234,7 @@ void destroyCursor(Object cursor_handle); /* Pbuffer */ - int getPbufferCaps(); + int getPbufferCapabilities(); /** * Method to test for buffer integrity Index: MacOSXDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MacOSXDisplay.java 11 Jan 2005 13:53:09 -0000 1.16 +++ MacOSXDisplay.java 18 Jan 2005 12:34:33 -0000 1.17 @@ -288,7 +288,7 @@ private native void nGrabMouse(boolean grab); - public int getNativeCursorCaps() { + public int getNativeCursorCapabilities() { /* int cursor_colors = Toolkit.getDefaultToolkit().getMaximumCursorColors(); boolean supported = cursor_colors >= Short.MAX_VALUE && getMaxCursorSize() > 0; @@ -373,7 +373,7 @@ public void destroyCursor(Object cursor_handle) { } - public int getPbufferCaps() { + public int getPbufferCapabilities() { return GL11.glGetString(GL11.GL_EXTENSIONS).indexOf("GL_APPLE_pixel_buffer") != -1 ? Pbuffer.PBUFFER_SUPPORTED : 0; } Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- LinuxDisplay.java 11 Jan 2005 15:22:06 -0000 1.9 +++ LinuxDisplay.java 18 Jan 2005 12:34:33 -0000 1.10 @@ -269,13 +269,13 @@ } public native void nGrabMouse(boolean grab); - public int getNativeCursorCaps() { + public int getNativeCursorCapabilities() { lockAWT(); - int caps = nGetNativeCursorCaps(); + int caps = nGetNativeCursorCapabilities(); unlockAWT(); return caps; } - public native int nGetNativeCursorCaps(); + public native int nGetNativeCursorCapabilities(); public void setNativeCursor(Object handle) throws LWJGLException { lockAWT(); @@ -365,13 +365,13 @@ } public native void nDestroyCursor(Object cursorHandle); - public int getPbufferCaps() { + public int getPbufferCapabilities() { lockAWT(); - int caps = nGetPbufferCaps(); + int caps = nGetPbufferCapabilities(); unlockAWT(); return caps; } - public native int nGetPbufferCaps(); + public native int nGetPbufferCapabilities(); public boolean isBufferLost(ByteBuffer handle) { return false; |
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/java/org/lwjgl/test/input Modified Files: HWCursorTest.java Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- HWCursorTest.java 13 Dec 2004 06:26:23 -0000 1.39 +++ HWCursorTest.java 18 Jan 2005 12:34:34 -0000 1.40 @@ -114,7 +114,7 @@ } private static void initNativeCursors() throws Exception { - if ((Mouse.getNativeCursorCaps() & Mouse.CURSOR_ONE_BIT_TRANSPARENCY) == 0) { + if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) { System.out.println("No HW cursor support!"); System.exit(0); } |
|
From: Elias N. <eli...@us...> - 2005-01-18 12:35:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22609/src/java/org/lwjgl/input Modified Files: Cursor.java Mouse.java Log Message: Moved Mouse.getNativeCursorCaps() to Cursor.getCapabilities() Renamed Pbuffer.getPbufferCaps() to Pbuffer.getCapabilities() Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- Cursor.java 20 Nov 2004 16:46:44 -0000 1.32 +++ Cursor.java 18 Jan 2005 12:34:32 -0000 1.33 @@ -50,6 +50,15 @@ */ public class Cursor { + /** 1 bit transparency for native cursor */ + public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1; + + /** 8 bit alhpa native cursor */ + public static final int CURSOR_8_BIT_ALPHA = 2; + + /** animation native cursor */ + public static final int CURSOR_ANIMATION = 4; + /** First element to display */ private final CursorElement[] cursors; @@ -72,6 +81,8 @@ * @throws LWJGLException if the cursor could not be created for any reason */ public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { + if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) + throw new IllegalStateException("Native cursors not supported"); BufferChecks.checkBuffer(images, width*height*numImages); if (!Mouse.isCreated()) throw new IllegalStateException("Mouse must be created before creating cursor objects"); @@ -92,7 +103,41 @@ // create cursor (or cursors if multiple images supplied) cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays); } - + + /** + * Gets the minimum size of a native cursor. Can only be called if + * The Mouse is created and cursor caps includes at least + * CURSOR_ONE_BIT_TRANSPARANCY. + * + * @return the maximum size of a native cursor + */ + public static int getMinCursorSize() { + return Display.getImplementation().getMinCursorSize(); + } + + /** + * Gets the maximum size of a native cursor. Can only be called if + * The Mouse is created and cursor caps includes at least + * CURSOR_ONE_BIT_TRANSPARANCY. + * + * @return the maximum size of a native cursor + */ + public static int getMaxCursorSize() { + return Display.getImplementation().getMaxCursorSize(); + } + + /** + * Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities. + * The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy, + * the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates + * support for cursor animations. + * + * @return A bit mask with native cursor capabilities. + */ + public static int getCapabilities() { + return Display.getImplementation().getNativeCursorCapabilities(); + } + /** * Creates the actual cursor, using a platform specific class */ Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- Mouse.java 10 Jan 2005 08:19:27 -0000 1.72 +++ Mouse.java 18 Jan 2005 12:34:32 -0000 1.73 @@ -58,16 +58,6 @@ * @version $Revision$ */ public class Mouse { - - /** 1 bit transparency for native cursor */ - public static final int CURSOR_ONE_BIT_TRANSPARENCY = 1; - - /** 8 bit alhpa native cursor */ - public static final int CURSOR_8_BIT_ALPHA = 2; - - /** animation native cursor */ - public static final int CURSOR_ANIMATION = 4; - /** Mouse constraint */ private static int width, height; @@ -156,18 +146,6 @@ } /** - * Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities. - * The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy, - * the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates - * support for cursor animations. - * - * @return A bit mask with native cursor capabilities. - */ - public static int getNativeCursorCaps() { - return Display.getImplementation().getNativeCursorCaps(); - } - - /** * Binds a native cursor. If the cursor argument is null, the * native cursor is disabled, as if native cursors were not supported. * @@ -183,7 +161,7 @@ * @throws LWJGLException if the cursor could not be set for any reason */ public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException { - if ((getNativeCursorCaps() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) + if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) throw new IllegalStateException("Mouse doesn't support native cursors"); Cursor oldCursor = currentCursor; currentCursor = cursor; @@ -199,28 +177,6 @@ } /** - * Gets the minimum size of a native cursor. Can only be called if - * The Mouse is created and cursor caps includes at least - * CURSOR_ONE_BIT_TRANSPARANCY. - * - * @return the maximum size of a native cursor - */ - public static int getMinCursorSize() { - return Display.getImplementation().getMinCursorSize(); - } - - /** - * Gets the maximum size of a native cursor. Can only be called if - * The Mouse is created and cursor caps includes at least - * CURSOR_ONE_BIT_TRANSPARANCY. - * - * @return the maximum size of a native cursor - */ - public static int getMaxCursorSize() { - return Display.getImplementation().getMaxCursorSize(); - } - - /** * Static initialization */ private static void initialize() { |
|
From: Elias N. <eli...@us...> - 2005-01-18 11:58:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14266/opengl Modified Files: Pbuffer.java Log Message: Added supported check to Pbuffer constructor Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Pbuffer.java 11 Jan 2005 13:53:09 -0000 1.33 +++ Pbuffer.java 18 Jan 2005 11:58:33 -0000 1.34 @@ -175,6 +175,8 @@ * with the Display context (if created). */ public Pbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture, Pbuffer shared_context) throws LWJGLException { + if ((getPbufferCaps() & PBUFFER_SUPPORTED) == 0) + throw new IllegalStateException("Pbuffers are not supported"); this.width = width; this.height = height; this.handle = createPbuffer(width, height, pixel_format, renderTexture, shared_context != null ? shared_context.handle : null); |
|
From: Elias N. <eli...@us...> - 2005-01-16 11:13:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9066/src/native/win32 Modified Files: display.c Log Message: Win32: hardened getAvailableDisplayModes Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/display.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- display.c 9 Dec 2004 15:36:13 -0000 1.1 +++ display.c 16 Jan 2005 11:12:57 -0000 1.2 @@ -79,10 +79,11 @@ HMODULE lib_handle = LoadLibrary("user32.dll"); int i = 0, j = 0, n = 0; - int AvailableModes = 0; DISPLAY_DEVICE DisplayDevice; DEVMODE DevMode; + jobject *display_mode_objects = NULL; + int list_size = 0; jclass displayModeClass; @@ -106,33 +107,9 @@ DevMode.dmSize = sizeof(DEVMODE); DisplayDevice.cb = sizeof(DISPLAY_DEVICE); - //enumerate all displays, and all of their displaymodes - while(EnumDisplayDevicesA(NULL, i++, &DisplayDevice, 0) != 0) { - // continue if mirroring device - if((DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) != 0) { - continue; - } - - // go ahead - printfDebug("Querying %s device\n", DisplayDevice.DeviceString); - j = 0; - while(EnumDisplaySettingsExA((const char *) DisplayDevice.DeviceName, j++, &DevMode, 0) != 0) { - if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) { - AvailableModes++; - } - } - } - - printfDebug("Found %d displaymodes\n", AvailableModes); - - // now that we have the count create the classes, and add 'em all - we'll remove dups in Java - // Allocate an array of DisplayModes big enough - displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); - - ret = (*env)->NewObjectArray(env, AvailableModes, displayModeClass, NULL); - displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); - - i = 0, n = 0; + displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); + displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); + while(EnumDisplayDevicesA(NULL, i++, &DisplayDevice, 0) != 0) { // continue if mirroring device if((DisplayDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) != 0) { @@ -144,14 +121,26 @@ // Filter out indexed modes if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) { jobject displayMode; - displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, + if (list_size <= n) { + list_size += 1; + display_mode_objects = (jobject *)realloc(display_mode_objects, sizeof(jobject)*list_size); + if (display_mode_objects == NULL) + return NULL; + } + displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, DevMode.dmPelsWidth, DevMode.dmPelsHeight, DevMode.dmBitsPerPel, DevMode.dmDisplayFrequency); - - (*env)->SetObjectArrayElement(env, ret, n++, displayMode); + display_mode_objects[n++] = displayMode; } } } + printfDebug("Found %d displaymodes\n", n); + + ret = (*env)->NewObjectArray(env, n, displayModeClass, NULL); + for (i = 0; i < n; i++) { + (*env)->SetObjectArrayElement(env, ret, i, display_mode_objects[i]); + } + free(display_mode_objects); FreeLibrary(lib_handle); return ret; } @@ -161,46 +150,46 @@ */ static jobjectArray GetAvailableDisplayModes(JNIEnv * env) { int i = 0, j = 0, n = 0; - int AvailableModes = 0; DEVMODE DevMode; - jclass displayModeClass; + jclass displayModeClass; - jobjectArray ret; - jmethodID displayModeConstructor; + jobjectArray ret; + jmethodID displayModeConstructor; + jobject *display_mode_objects = NULL; + int list_size = 0; ZeroMemory(&DevMode, sizeof(DEVMODE)); DevMode.dmSize = sizeof(DEVMODE); - //enumerate all displaymodes - while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) { - if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) { - AvailableModes++; - } - } - - printfDebug("Found %d displaymodes\n", AvailableModes); - - // now that we have the count create the classes, and add 'em all - we'll remove dups in Java - // Allocate an array of DisplayModes big enough displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); - ret = (*env)->NewObjectArray(env, AvailableModes, displayModeClass, NULL); displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); - i = 0, j = 0, n = 0; while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) { // Filter out indexed modes if (DevMode.dmBitsPerPel > 8 && ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN | CDS_TEST) == DISP_CHANGE_SUCCESSFUL) { jobject displayMode; + if (list_size <= n) { + list_size += 1; + display_mode_objects = (jobject *)realloc(display_mode_objects, sizeof(jobject)*list_size); + if (display_mode_objects == NULL) + return NULL; + } displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, DevMode.dmPelsWidth, DevMode.dmPelsHeight, DevMode.dmBitsPerPel, DevMode.dmDisplayFrequency); - (*env)->SetObjectArrayElement(env, ret, n++, displayMode); + display_mode_objects[n++] = displayMode; } } + ret = (*env)->NewObjectArray(env, n, displayModeClass, NULL); + for (i = 0; i < n; i++) { + (*env)->SetObjectArrayElement(env, ret, i, display_mode_objects[i]); + } + free(display_mode_objects); + printfDebug("Found %d displaymodes\n", n); return ret; } |
|
From: Elias N. <eli...@us...> - 2005-01-16 11:13:07
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9066/platform_build/win32_ms_cmdline Modified Files: build.bat Log Message: Win32: hardened getAvailableDisplayModes Index: build.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build.bat,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build.bat 14 Jan 2005 10:01:38 -0000 1.11 +++ build.bat 16 Jan 2005 11:12:56 -0000 1.12 @@ -6,7 +6,7 @@ if "%ALHOME%" == "" goto erroralhome if "%EAXHOME%" == "" goto erroreaxhome if "%DXHOME%" == "" goto errordxhome -set COPTIONS=/I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"%EAXHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W0 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" +set COPTIONS=/I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"%EAXHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" set LINKEROPTS=/link /LIBPATH:"%ALHOME%\libs" /LIBPATH:"%EAXHOME%\Libs" /LIBPATH:"%DXHOME%\Lib" /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL set LIBS=dinput.lib dxguid.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib |
|
From: Elias N. <eli...@us...> - 2005-01-16 10:43:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5277 Modified Files: Makefile display.c Log Message: Linux: Hardened getAvailableDisplayModes so that it won't be confused by a changing number of display modes while it is executing Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- display.c 12 Dec 2004 17:07:45 -0000 1.6 +++ display.c 16 Jan 2005 10:43:30 -0000 1.7 @@ -147,31 +147,30 @@ static mode_info *getXrandrDisplayModes(Display *disp, int screen, int *num_modes) { int num_randr_sizes; XRRScreenSize *sizes = XRRSizes(disp, screen, &num_randr_sizes); + mode_info *avail_modes = NULL; + int list_size = 0; /* Count number of modes */ - int num_randr_modes = 0; int i; - for (i = 0; i < num_randr_sizes; i++) { - int num_randr_rates; - XRRRates(disp, screen, i, &num_randr_rates); - num_randr_modes += num_randr_rates; - } - mode_info *avail_modes = (mode_info *)malloc(sizeof(mode_info)*num_randr_modes); - if (avail_modes == NULL) - return NULL; - int mode = 0; + int mode_index = 0; for (i = 0; i < num_randr_sizes; i++) { int num_randr_rates; short *freqs = XRRRates(disp, screen, i, &num_randr_rates); int j; for (j = 0; j < num_randr_rates; j++) { - avail_modes[mode].width = sizes[i].width; - avail_modes[mode].height = sizes[i].height; - avail_modes[mode].freq = freqs[j]; - avail_modes[mode].mode_data.size_index = i; - mode++; + if (list_size <= mode_index) { + list_size += 1; + avail_modes = (mode_info *)realloc(avail_modes, sizeof(mode_info)*list_size); + if (avail_modes == NULL) + return NULL; + } + avail_modes[mode_index].width = sizes[i].width; + avail_modes[mode_index].height = sizes[i].height; + avail_modes[mode_index].freq = freqs[j]; + avail_modes[mode_index].mode_data.size_index = i; + mode_index++; } } - *num_modes = num_randr_modes; + *num_modes = mode_index; return avail_modes; } Index: Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile 11 Jan 2005 15:22:09 -0000 1.16 +++ Makefile 16 Jan 2005 10:43:30 -0000 1.17 @@ -4,7 +4,7 @@ LINKER=gcc STRIP=strip CFLAGS_LINK=-shared -Wall -LIBS=-L/usr/X11/lib -lX11 -lXext -lXxf86vm -lpthread -L/usr/lib/jvm/java-1.4.2-sun-1.4.2.05/jre/lib/i386/ -ljawt -Wl,-static,-lXcursor,-lXrender,-lXrandr,-call_shared +LIBS=-L/usr/X11/lib -lX11 -lXext -lXxf86vm -lpthread -L/usr/lib/jvm/java-1.4.2-sun-1.4.2.06/jre/lib/i386/ -ljawt -Wl,-static,-lXcursor,-lXrender,-lXrandr,-call_shared CFLAGS_O=-fPIC -O2 -D_X11 -Wall -pthread -c -I../common -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux SRC=$(wildcard *.c) $(wildcard ../common/*.c) $(wildcard ../common/arb/*.c) $(wildcard ../common/ati/*.c) $(wildcard ../common/ext/*.c) $(wildcard ../common/nv/*.c) OBJECTS=$(subst .c,.o,$(SRC)) |
|
From: Ioannis T. <sp...@us...> - 2005-01-15 23:53:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21663 Modified Files: org_lwjgl_opengl_Display.c Log Message: createARBContextAndPixelFormat didn't return true when ok Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_Display.c 15 Jan 2005 15:45:54 -0000 1.4 +++ org_lwjgl_opengl_Display.c 15 Jan 2005 23:52:53 -0000 1.5 @@ -699,42 +699,49 @@ } static bool createARBContextAndPixelFormat(JNIEnv *env, HDC hdc, jobject pixel_format, int *pixel_format_index_return, HGLRC *context_return) { - int pixel_format_index; - HWND arb_hwnd; - HDC arb_hdc; - HGLRC arb_context; + int pixel_format_index; + HWND arb_hwnd; + HDC arb_hdc; + HGLRC arb_context; + // Some crazy strangeness here so we can use ARB_pixel_format to specify the number // of multisamples we want. If the extension is present we'll delete the existing // rendering context and start over, using the ARB extension instead to pick the context. - if (!extgl_Extensions.WGL_ARB_pixel_format) + if ( !extgl_Extensions.WGL_ARB_pixel_format ) return false; - pixel_format_index = findPixelFormatARB(env, hdc, pixel_format, NULL, true, true, true, true); - if (pixel_format_index == -1) { - pixel_format_index = findPixelFormatARB(env, hdc, pixel_format, NULL, true, true, false, true); - if (pixel_format_index == -1) + + pixel_format_index = findPixelFormatARB(env, hdc, pixel_format, NULL, true, true, true, true); + if ( pixel_format_index == -1 ) { + pixel_format_index = findPixelFormatARB(env, hdc, pixel_format, NULL, true, true, false, true); + if ( pixel_format_index == -1 ) return false; } - arb_hwnd = createWindow(0, 0, 1, 1, false, false); - if (arb_hwnd == NULL) + + arb_hwnd = createWindow(0, 0, 1, 1, false, false); + if ( arb_hwnd == NULL ) return false; - arb_hdc = GetDC(arb_hwnd); - if (!applyPixelFormat(arb_hdc, pixel_format_index)) { + + arb_hdc = GetDC(arb_hwnd); + if ( !applyPixelFormat(arb_hdc, pixel_format_index) ) { closeWindow(arb_hwnd, arb_hdc); return false; } - arb_context = wglCreateContext(arb_hdc); + + arb_context = wglCreateContext(arb_hdc); closeWindow(arb_hwnd, arb_hdc); - if (arb_context == NULL) { + if ( arb_context == NULL ) return false; - } - if (!wglMakeCurrent(arb_hdc, arb_context)) { + + if ( !wglMakeCurrent(arb_hdc, arb_context) ) { wglDeleteContext(arb_context); return false; } + extgl_InitWGL(env); *pixel_format_index_return = pixel_format_index; *context_return = arb_context; - return; + + return true; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createContext(JNIEnv *env, jobject self, jobject pixel_format) { |
|
From: Ioannis T. <sp...@us...> - 2005-01-15 23:51:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21205 Modified Files: org_lwjgl_opengl_GL14.c org_lwjgl_opengl_GL20.c Log Message: Completed GL 2.0 Index: org_lwjgl_opengl_GL14.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL14.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_GL14.c 10 Sep 2004 08:13:49 -0000 1.1 +++ org_lwjgl_opengl_GL14.c 15 Jan 2005 23:50:55 -0000 1.2 @@ -1,35 +1,35 @@ -/* +/* * 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 + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * 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 + * * 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 + * 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 + * 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. */ - + /** * $Id$ * @@ -48,7 +48,9 @@ typedef void (APIENTRY * glFogCoordPointerPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * glMultiDrawArraysPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); typedef void (APIENTRY * glPointParameterfPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * glPointParameteriPROC) (GLenum pname, GLint param); typedef void (APIENTRY * glPointParameterfvPROC) (GLenum pname, GLfloat *params); +typedef void (APIENTRY * glPointParameterivPROC) (GLenum pname, GLint *params); typedef void (APIENTRY * glSecondaryColor3bPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRY * glSecondaryColor3fPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (APIENTRY * glSecondaryColor3ubPROC) (GLubyte red, GLubyte green, GLubyte blue); @@ -63,7 +65,9 @@ static glFogCoordPointerPROC glFogCoordPointer; static glMultiDrawArraysPROC glMultiDrawArrays; static glPointParameterfPROC glPointParameterf; +static glPointParameteriPROC glPointParameteri; static glPointParameterfvPROC glPointParameterfv; +static glPointParameterivPROC glPointParameteriv; static glSecondaryColor3bPROC glSecondaryColor3b; static glSecondaryColor3fPROC glSecondaryColor3f; static glSecondaryColor3ubPROC glSecondaryColor3ub; @@ -80,14 +84,11 @@ (JNIEnv *env, jclass clazz, jint mode) { glBlendEquation(mode); - } - static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendColor(JNIEnv * env, jclass clazz, jfloat p0, jfloat p1, jfloat p2, jfloat p3) { glBlendColor((GLfloat) p0, (GLfloat) p1, (GLfloat) p2, (GLfloat) p3); - } /* @@ -110,7 +111,7 @@ (JNIEnv *env, jclass clazz, jint p1, jint p2, jobject buffer, jint offset) { GLvoid *address = (GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glFogCoordPointer(p1, p2, address); - + } /* @@ -121,7 +122,6 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO (JNIEnv *env, jclass clazz, jint p1, jint p2, jint buffer_offset) { glFogCoordPointer(p1, p2, offsetToPointer(buffer_offset)); - } /* @@ -134,9 +134,8 @@ GLint *address = first_offset + (GLint *)(*env)->GetDirectBufferAddress(env, first); GLsizei *address2 = count_offset + (GLsizei *)(*env)->GetDirectBufferAddress(env, count); glMultiDrawArrays(mode, address, address2, (GLsizei)primcount); - } - + /* * Class: org_lwjgl_opengl_GL14 * Method: glPointParameterf @@ -145,7 +144,16 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_glPointParameterf (JNIEnv *env, jclass clazz, jint p1, jfloat p2) { glPointParameterf(p1, p2); - +} + +/* + * Class: org_lwjgl_opengl_GL14 + * Method: glPointParameteri + * Signature: (IF)V + */ +static void JNICALL Java_org_lwjgl_opengl_GL14_glPointParameteri + (JNIEnv *env, jclass clazz, jint p1, jint p2) { + glPointParameteri(p1, p2); } /* @@ -157,7 +165,17 @@ (JNIEnv *env, jclass clazz, jint p1, jobject buffer, jint offset) { GLfloat *address = offset + (GLfloat *)(*env)->GetDirectBufferAddress(env, buffer); glPointParameterfv(p1, address); - +} + +/* + * Class: org_lwjgl_opengl_GL14 + * Method: glPointParameteriv + * Signature: (ILjava/nio/IntBuffer;)V + */ +static void JNICALL Java_org_lwjgl_opengl_GL14_nglPointParameteriv + (JNIEnv *env, jclass clazz, jint p1, jobject buffer, jint offset) { + GLint *address = offset + (GLint *)(*env)->GetDirectBufferAddress(env, buffer); + glPointParameteriv(p1, address); } /* @@ -201,7 +219,7 @@ (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jobject buffer, jint offset) { const GLvoid *address = (const GLvoid *)(offset + (GLbyte *)(*env)->GetDirectBufferAddress(env, buffer)); glSecondaryColorPointer(p1, p2, p3, address); - + } /* @@ -212,7 +230,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointerVBO (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint buffer_offset) { glSecondaryColorPointer(p1, p2, p3, offsetToPointer(buffer_offset)); - + } /* @@ -223,7 +241,7 @@ static void JNICALL Java_org_lwjgl_opengl_GL14_glBlendFuncSeparate (JNIEnv *env, jclass clazz, jint p1, jint p2, jint p3, jint p4) { glBlendFuncSeparate(p1, p2, p3, p4); - + } @@ -281,7 +299,9 @@ {"nglFogCoordPointerVBO", "(III)V", (void*)&Java_org_lwjgl_opengl_GL14_nglFogCoordPointerVBO, NULL, NULL}, {"nglMultiDrawArrays", "(ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;II)V", (void*)&Java_org_lwjgl_opengl_GL14_nglMultiDrawArrays, "glMultiDrawArrays", (void*)&glMultiDrawArrays}, {"glPointParameterf", "(IF)V", (void*)&Java_org_lwjgl_opengl_GL14_glPointParameterf, "glPointParameterf", (void*)&glPointParameterf}, + {"glPointParameteri", "(II)V", (void*)&Java_org_lwjgl_opengl_GL14_glPointParameteri, "glPointParameteri", (void*)&glPointParameteri}, {"nglPointParameterfv", "(ILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglPointParameterfv, "glPointParameterfv", (void*)&glPointParameterfv}, + {"nglPointParameteriv", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL14_nglPointParameteriv, "glPointParameteriv", (void*)&glPointParameteriv}, {"glSecondaryColor3b", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3b, "glSecondaryColor3b", (void*)&glSecondaryColor3b}, {"glSecondaryColor3f", "(FFF)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3f, "glSecondaryColor3f", (void*)&glSecondaryColor3f}, {"glSecondaryColor3ub", "(BBB)V", (void*)&Java_org_lwjgl_opengl_GL14_glSecondaryColor3ub, "glSecondaryColor3ub", (void*)&glSecondaryColor3ub}, Index: org_lwjgl_opengl_GL20.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL20.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_opengl_GL20.c 29 Oct 2004 19:45:42 -0000 1.2 +++ org_lwjgl_opengl_GL20.c 15 Jan 2005 23:50:55 -0000 1.3 @@ -93,6 +93,46 @@ static GLchar** sources = NULL;; static GLint* sourcesLengths = NULL; +// ARB_vertex_program +typedef void (APIENTRY * glVertexAttrib1sPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * glVertexAttrib1fPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * glVertexAttrib2sPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * glVertexAttrib2fPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * glVertexAttrib3sPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * glVertexAttrib3fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * glVertexAttrib4sPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * glVertexAttrib4fPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * glVertexAttrib4NubPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY * glVertexAttrib1svPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * glVertexAttrib1fvPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * glVertexAttrib2svPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * glVertexAttrib2fvPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * glVertexAttrib2dvPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * glVertexAttrib3svPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * glVertexAttrib3fvPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * glVertexAttrib3dvPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * glVertexAttrib4bvPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRY * glVertexAttrib4svPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * glVertexAttrib4ivPROC) (GLuint index, const GLint *v); +typedef void (APIENTRY * glVertexAttrib4ubvPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * glVertexAttrib4usvPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRY * glVertexAttrib4uivPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRY * glVertexAttrib4fvPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * glVertexAttrib4dvPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * glVertexAttrib4NbvPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRY * glVertexAttrib4NsvPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * glVertexAttrib4NivPROC) (GLuint index, const GLint *v); +typedef void (APIENTRY * glVertexAttrib4NubvPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * glVertexAttrib4NusvPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRY * glVertexAttrib4NuivPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRY * glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * glEnableVertexAttribArrayPROC) (GLuint index); +typedef void (APIENTRY * glDisableVertexAttribArrayPROC) (GLuint index); +typedef void (APIENTRY * glGetVertexAttribdvPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * glGetVertexAttribfvPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * glGetVertexAttribivPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * glGetVertexAttribPointervPROC) (GLuint index, GLenum pname, GLvoid **pointer); + // ARB_vertex_shader typedef void (APIENTRY * glBindAttribLocationPROC) (GLuint program, GLuint index, const GLchar *name); typedef void (APIENTRY * glGetActiveAttribPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, const GLchar *name); @@ -100,8 +140,11 @@ // ARB_draw_buffers typedef void (APIENTRY * glDrawBuffersPROC) (GLsizei n, const GLenum *bufs); // Two-Sided Stencil -typedef void (APIENTRY * glStencilFuncSeparatePROC) (GLenum face, GLenum func, GLint ref, GLuint mask); typedef void (APIENTRY * glStencilOpSeparatePROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRY * glStencilFuncSeparatePROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRY * glStencilMaskSeparatePROC) (GLenum face, GLuint mask); +// EXT_blend_equation_separate +typedef void (APIENTRY * glBlendEquationSeparatePROC) (GLenum modeRGB, GLenum modeAlpha); // ARB_shader_objects static glAttachShaderPROC glAttachShader; @@ -148,6 +191,22 @@ static glUniformMatrix4fvPROC glUniformMatrix4fv; static glUseProgramPROC glUseProgram; static glValidateProgramPROC glValidateProgram; +// ARB_vertex_program +static glVertexAttrib1sPROC glVertexAttrib1s; +static glVertexAttrib1fPROC glVertexAttrib1f; +static glVertexAttrib2sPROC glVertexAttrib2s; +static glVertexAttrib2fPROC glVertexAttrib2f; +static glVertexAttrib3sPROC glVertexAttrib3s; +static glVertexAttrib3fPROC glVertexAttrib3f; +static glVertexAttrib4sPROC glVertexAttrib4s; +static glVertexAttrib4fPROC glVertexAttrib4f; +static glVertexAttrib4NubPROC glVertexAttrib4Nub; +static glVertexAttribPointerPROC glVertexAttribPointer; +static glEnableVertexAttribArrayPROC glEnableVertexAttribArray; +static glDisableVertexAttribArrayPROC glDisableVertexAttribArray; +static glGetVertexAttribfvPROC glGetVertexAttribfv; +static glGetVertexAttribivPROC glGetVertexAttribiv; +static glGetVertexAttribPointervPROC glGetVertexAttribPointerv; // ARB_vertex_shader static glBindAttribLocationPROC glBindAttribLocation; static glGetActiveAttribPROC glGetActiveAttrib; @@ -155,8 +214,11 @@ // ARB_draw_buffers static glDrawBuffersPROC glDrawBuffers; // Two-Sided Stencil -static glStencilFuncSeparatePROC glStencilFuncSeparate; static glStencilOpSeparatePROC glStencilOpSeparate; +static glStencilFuncSeparatePROC glStencilFuncSeparate; +static glStencilMaskSeparatePROC glStencilMaskSeparate; +// EXT_blend_equation_separate +static glBlendEquationSeparatePROC glBlendEquationSeparate; // ------------------------------------------------------------------ // ----------------------[ ARB_shader_objects ]---------------------- @@ -686,6 +748,191 @@ } // ------------------------------------------------------------------ +// ----------------------[ ARB_vertex_program ]---------------------- +// ------------------------------------------------------------------ + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib1s + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib1s + (JNIEnv * env, jclass clazz, jint index, jshort x) +{ + glVertexAttrib1s(index, x); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib1f + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib1f + (JNIEnv * env, jclass clazz, jint index, jfloat x) +{ + glVertexAttrib1f(index, x); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib2s + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib2s + (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y) +{ + glVertexAttrib2s(index, x, y); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib2f + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib2f + (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y) +{ + glVertexAttrib2f(index, x, y); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib3s + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib3s + (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z) +{ + glVertexAttrib3s(index, x, y, z); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib3f + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib3f + (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z) +{ + glVertexAttrib3f(index, x, y, z); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib4s + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4s + (JNIEnv * env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w) +{ + glVertexAttrib4s(index, x, y, z, w); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib4f + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4f + (JNIEnv * env, jclass clazz, jint index, jfloat x, jfloat y, jfloat z, jfloat w) +{ + glVertexAttrib4f(index, x, y, z, w); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glVertexAttrib4Nub + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glVertexAttrib4Nub + (JNIEnv * env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w) +{ + glVertexAttrib4Nub(index, x, y, z, w); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: nglVertexAttribPointer + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointer + (JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jobject buffer, jint bufferOffset) +{ + GLvoid *buffer_ptr = (GLvoid *)((GLubyte *)(*env)->GetDirectBufferAddress(env, buffer) + bufferOffset); + glVertexAttribPointer(index, size, type, normalized, stride, buffer_ptr); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: nglVertexAttribPointerVBO + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerVBO + (JNIEnv * env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jint bufferOffset) +{ + glVertexAttribPointer(index, size, type, normalized, stride, (GLvoid *)bufferOffset); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glEnableVertexAttribArray + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glEnableVertexAttribArray + (JNIEnv * env, jclass clazz, jint index) +{ + glEnableVertexAttribArray(index); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glDisableVertexAttribArray + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glDisableVertexAttribArray + (JNIEnv * env, jclass clazz, jint index) +{ + glDisableVertexAttribArray(index); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: nglGetVertexAttribfv + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv + (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) +{ + GLfloat *params_ptr = (GLfloat *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; + glGetVertexAttribfv(index, pname, params_ptr); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: nglGetVertexAttribiv + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv + (JNIEnv * env, jclass clazz, jint index, jint pname, jobject params, jint paramsOffset) +{ + GLint *params_ptr = (GLint *)(*env)->GetDirectBufferAddress(env, params) + paramsOffset; + glGetVertexAttribiv(index, pname, params_ptr); + +} + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glGetVertexAttribPointer + */ +static jobject JNICALL Java_org_lwjgl_opengl_GL20_glGetVertexAttribPointer + (JNIEnv * env, jclass clazz, jint index, jint pname, jint size) +{ + void *address; + glGetVertexAttribPointerv((GLuint)index, (GLuint)pname, &address); + + return safeNewBuffer(env, address, size); +} + +// ------------------------------------------------------------------ // ----------------------[ ARB_vertex_shaders ]---------------------- // ------------------------------------------------------------------ /* @@ -750,6 +997,16 @@ /* * Class: org.lwjgl.opengl.GL20 + * Method: glStencilOpSeparate + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilOpSeparate + (JNIEnv * env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass) +{ + glStencilOpSeparate(face, sfail, dpfail, dppass); +} + +/* + * Class: org.lwjgl.opengl.GL20 * Method: glStencilFuncSeparate */ static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilFuncSeparate @@ -760,12 +1017,26 @@ /* * Class: org.lwjgl.opengl.GL20 - * Method: glStencilOpSeparate + * Method: glStencilMaskSeparate */ -static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilOpSeparate - (JNIEnv * env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass) +static void JNICALL Java_org_lwjgl_opengl_GL20_glStencilMaskSeparate + (JNIEnv * env, jclass clazz, jint face, jint mask) { - glStencilOpSeparate(face, sfail, dpfail, dppass); + glStencilMaskSeparate(face, mask); +} + +// ----------------------------------------------------------------- +// ----------------------[ EXT_blend_equation_separate ]---------------------- +// ----------------------------------------------------------------- + +/* + * Class: org.lwjgl.opengl.GL20 + * Method: glBlendEquationSeparate + */ +static void JNICALL Java_org_lwjgl_opengl_GL20_glBlendEquationSeparate + (JNIEnv * env, jclass clazz, jint modeRGB, jint modeAlpha) +{ + glBlendEquationSeparate(modeRGB, modeAlpha); } #ifdef __cplusplus @@ -820,6 +1091,23 @@ {"nglGetUniformfv", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformfv, "glGetUniformfv", (void*)&glGetUniformfv}, {"nglGetUniformiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetUniformiv, "glGetUniformiv", (void*)&glGetUniformiv}, {"nglGetShaderSource", "(IILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetShaderSource, "glGetShaderSource", (void*)&glGetShaderSource}, + // ARB_vertex_program + {"glVertexAttrib1s", "(IS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib1s, "glVertexAttrib1s", (void*)&glVertexAttrib1s}, + {"glVertexAttrib1f", "(IF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib1f, "glVertexAttrib1f", (void*)&glVertexAttrib1f}, + {"glVertexAttrib2s", "(ISS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib2s, "glVertexAttrib2s", (void*)&glVertexAttrib2s}, + {"glVertexAttrib2f", "(IFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib2f, "glVertexAttrib2f", (void*)&glVertexAttrib2f}, + {"glVertexAttrib3s", "(ISSS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib3s, "glVertexAttrib3s", (void*)&glVertexAttrib3s}, + {"glVertexAttrib3f", "(IFFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib3f, "glVertexAttrib3f", (void*)&glVertexAttrib3f}, + {"glVertexAttrib4s", "(ISSSS)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4s, "glVertexAttrib4s", (void*)&glVertexAttrib4s}, + {"glVertexAttrib4f", "(IFFFF)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4f, "glVertexAttrib4f", (void*)&glVertexAttrib4f}, + {"glVertexAttrib4Nub", "(IBBBB)V", (void*)&Java_org_lwjgl_opengl_GL20_glVertexAttrib4Nub, "glVertexAttrib4Nub", (void*)&glVertexAttrib4Nub}, + {"nglVertexAttribPointer", "(IIIZILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglVertexAttribPointer, "glVertexAttribPointer", (void*)&glVertexAttribPointer}, + {"nglVertexAttribPointerVBO", "(IIIZII)V", (void*)&Java_org_lwjgl_opengl_GL20_nglVertexAttribPointerVBO, NULL, NULL}, + {"glEnableVertexAttribArray", "(I)V", (void*)&Java_org_lwjgl_opengl_GL20_glEnableVertexAttribArray, "glEnableVertexAttribArray", (void*)&glEnableVertexAttribArray}, + {"glDisableVertexAttribArray", "(I)V", (void*)&Java_org_lwjgl_opengl_GL20_glDisableVertexAttribArray, "glDisableVertexAttribArray", (void*)&glDisableVertexAttribArray}, + {"nglGetVertexAttribfv", "(IILjava/nio/FloatBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetVertexAttribfv, "glGetVertexAttribfv", (void*)&glGetVertexAttribfv}, + {"nglGetVertexAttribiv", "(IILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetVertexAttribiv, "glGetVertexAttribiv", (void*)&glGetVertexAttribiv}, + {"glGetVertexAttribPointer", "(III)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_opengl_GL20_glGetVertexAttribPointer, "glGetVertexAttribPointerv", (void*)&glGetVertexAttribPointerv}, // ARB_vertex_shader {"nglBindAttribLocation", "(IILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglBindAttribLocation, "glBindAttribLocation", (void*)&glBindAttribLocation}, {"nglGetActiveAttrib", "(IIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/IntBuffer;ILjava/nio/ByteBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglGetActiveAttrib, "glGetActiveAttrib", (void*)&glGetActiveAttrib}, @@ -827,8 +1115,11 @@ // ARB_draw_buffers {"nglDrawBuffers", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_opengl_GL20_nglDrawBuffers, "glDrawBuffers", (void*)&glDrawBuffers}, // Two-Sided Stencil + {"glStencilOpSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilOpSeparate, "glStencilOpSeparate", (void*)&glStencilOpSeparate}, {"glStencilFuncSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilFuncSeparate, "glStencilFuncSeparate", (void*)&glStencilFuncSeparate}, - {"glStencilOpSeparate", "(IIII)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilOpSeparate, "glStencilOpSeparate", (void*)&glStencilOpSeparate} + {"glStencilMaskSeparate", "(II)V", (void*)&Java_org_lwjgl_opengl_GL20_glStencilMaskSeparate, "glStencilMaskSeparate", (void*)&glStencilMaskSeparate}, + // EXT_blend_equation_separate + {"glBlendEquationSeparate", "(II)V", (void*)&Java_org_lwjgl_opengl_GL20_glBlendEquationSeparate, "glBlendEquationSeparate", (void*)&glBlendEquationSeparate} }; int num_functions = NUMFUNCTIONS(functions); extgl_InitializeClass(env, clazz, num_functions, functions); |
|
From: Ioannis T. <sp...@us...> - 2005-01-15 23:50:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20956 Modified Files: GL14.java GL20.java Log Message: Completed GL 2.0 Index: GL14.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL14.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- GL14.java 25 Nov 2004 22:20:44 -0000 1.14 +++ GL14.java 15 Jan 2005 23:49:58 -0000 1.15 @@ -125,20 +125,29 @@ } private static native void nglMultiDrawArrays(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount); -/* public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/ + /*public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/ + + public static native void glPointParameteri(int pname, int param); public static native void glPointParameterf(int pname, float param); + // --------------------------- + public static void glPointParameter(int pname, IntBuffer params) { + BufferChecks.checkBuffer(params); + nglPointParameteriv(pname, params, params.position()); + } + private static native void nglPointParameteriv(int pname, IntBuffer params, int params_offset); + // --------------------------- + + // --------------------------- public static void glPointParameter(int pname, FloatBuffer params) { BufferChecks.checkBuffer(params); nglPointParameterfv(pname, params, params.position()); } - private static native void nglPointParameterfv(int pname, FloatBuffer params, int params_offset); + // --------------------------- public static native void glSecondaryColor3b(byte red, byte green, byte blue); - public static native void glSecondaryColor3f(float red, float green, float blue); - public static native void glSecondaryColor3ub(byte red, byte green, byte blue); public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) { @@ -152,14 +161,12 @@ GLBufferChecks.ensureArrayVBOdisabled(); nglSecondaryColorPointer(size, GL11.GL_FLOAT, stride, data, data.position() << 2); } - private static native void nglSecondaryColorPointer(int size, int type, int stride, Buffer data, int data_offset); public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) { GLBufferChecks.ensureArrayVBOenabled(); nglSecondaryColorPointerVBO(size, type, stride, buffer_offset); } - private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset); public static native void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha); Index: GL20.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL20.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GL20.java 29 Oct 2004 19:43:16 -0000 1.2 +++ GL20.java 15 Jan 2005 23:49:58 -0000 1.3 @@ -34,10 +34,7 @@ import org.lwjgl.BufferChecks; import org.lwjgl.LWJGLException; -import java.nio.BufferOverflowException; -import java.nio.ByteBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; +import java.nio.*; public final class GL20 { @@ -47,18 +44,27 @@ static native void initNativeStubs() throws LWJGLException; // ------------------------------------------------------------------ + // ----------------------[ ARB_shading_language_100 ]---------------------- + // ------------------------------------------------------------------ + + /* + * Accepted by the <name> parameter of GetString: + */ + public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; + + // ------------------------------------------------------------------ // ----------------------[ ARB_shader_objects ]---------------------- // ------------------------------------------------------------------ /* - * Accepted by the <pname> argument of GetHandleARB: + * Accepted by the <pname> argument of GetInteger: */ - public static final int GL_PROGRAM_OBJECT = 0x8B40; + public static final int GL_CURRENT_PROGRAM = 0x8B8D; /* * Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: */ - public static final int GL_SHADER_TYPE = 0x8B4E; + public static final int GL_SHADER_TYPE = 0x8B4F; public static final int GL_DELETE_STATUS = 0x8B80; public static final int GL_COMPILE_STATUS = 0x8B81; public static final int GL_LINK_STATUS = 0x8B82; @@ -98,8 +104,6 @@ public static final int GL_SAMPLER_CUBE = 0x8B60; public static final int GL_SAMPLER_1D_SHADOW = 0x8B61; public static final int GL_SAMPLER_2D_SHADOW = 0x8B62; - public static final int GL_SAMPLER_2D_RECT = 0x8B63; - public static final int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64; // --------------------------- /** @@ -448,6 +452,83 @@ IntBuffer length, int lengthOffset, ByteBuffer source, int sourceOffset); // --------------------------- + // ------------------------------------------------------------------ + // ----------------------[ ARB_vertex_program ]---------------------- + // ------------------------------------------------------------------ + + public static native void glVertexAttrib1s(int index, short x); + + public static native void glVertexAttrib1f(int index, float x); + + public static native void glVertexAttrib2s(int index, short x, short y); + + public static native void glVertexAttrib2f(int index, float x, float y); + + public static native void glVertexAttrib3s(int index, short x, short y, short z); + + public static native void glVertexAttrib3f(int index, float x, float y, float z); + + public static native void glVertexAttrib4s(int index, short x, short y, short z, short w); + + public static native void glVertexAttrib4f(int index, float x, float y, float z, float w); + + public static native void glVertexAttrib4Nub(int index, byte x, byte y, byte z, byte w); + + public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ByteBuffer buffer) { + GLBufferChecks.ensureArrayVBOdisabled(); + nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, normalized, stride, buffer, buffer.position()); + } + + public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, ShortBuffer buffer) { + GLBufferChecks.ensureArrayVBOdisabled(); + nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, normalized, stride, buffer, buffer.position() << 1); + } + + public static void glVertexAttribPointer(int index, int size, boolean normalized, int stride, FloatBuffer buffer) { + GLBufferChecks.ensureArrayVBOdisabled(); + nglVertexAttribPointer(index, size, GL11.GL_FLOAT, normalized, stride, buffer, buffer.position() << 2); + } + + public static void glVertexAttribPointer(int index, int size, boolean unsigned, boolean normalized, int stride, IntBuffer buffer) { + GLBufferChecks.ensureArrayVBOdisabled(); + nglVertexAttribPointer(index, size, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, normalized, stride, buffer, buffer.position() << 2); + } + + private static native void nglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer buffer, int bufferOffset); + + // --------------------------- + public static void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, int bufferOffset) { + GLBufferChecks.ensureArrayVBOenabled(); + nglVertexAttribPointerVBO(index, size, type, normalized, stride, bufferOffset); + } + + private static native void nglVertexAttribPointerVBO(int index, int size, int type, boolean normalized, int stride, int bufferOffset); + // --------------------------- + + public static native void glEnableVertexAttribArray(int index); + + public static native void glDisableVertexAttribArray(int index); + + // --------------------------- + public static void glGetVertexAttrib(int index, int pname, FloatBuffer params) { + BufferChecks.checkBuffer(params); + nglGetVertexAttribfv(index, pname, params, params.position()); + } + + private static native void nglGetVertexAttribfv(int index, int pname, FloatBuffer params, int paramsOffset); + // --------------------------- + + // --------------------------- + public static void glGetVertexAttrib(int index, int pname, IntBuffer params) { + BufferChecks.checkBuffer(params); + nglGetVertexAttribiv(index, pname, params, params.position()); + } + + private static native void nglGetVertexAttribiv(int index, int pname, IntBuffer params, int paramsOffset); + // --------------------------- + + public static native ByteBuffer glGetVertexAttribPointer(int index, int pname, int size); + // ----------------------------------------------------------------- // ----------------------[ ARB_vertex_shader ]---------------------- // ----------------------------------------------------------------- @@ -617,6 +698,18 @@ */ public static final int GL_COORD_REPLACE = 0x8862; + /* + * Accepted by the <pname> parameter of PointParameter{if}vARB, and the + * <pname> of Get: + */ + public static final int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + + /* + * Accepted by the <param> parameter of PointParameter{if}vARB: + */ + public static final int GL_LOWER_LEFT = 0x8CA1; + public static final int GL_UPPER_LEFT = 0x8CA2; + // ----------------------------------------------------------------- // ----------------------[ Two-Sided Stencil ]---------------------- // ----------------------------------------------------------------- @@ -625,11 +718,23 @@ public static final int GL_STENCIL_BACK_FAIL = 0x8801; public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public static final int GL_STENCIL_BACK_REF = 0x0000; // TODO: Find this value - public static final int GL_STENCIL_BACK_VALUE_MASK = 0x0000; // TODO: Find this value + public static final int GL_STENCIL_BACK_REF = 0x8CA3; + public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; + public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5; + + public static native void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass); public static native void glStencilFuncSeparate(int face, int func, int ref, int mask); - public static native void glStencilOpSeparate(int face, int sfail, int dpfail, int dppass); + public static native void glStencilMaskSeparate(int face, int mask); + + // ------------------------------------------------------------- + // ----------------------[ EXT_blend_equation_separate ]---------------------- + // ------------------------------------------------------------- + + public static final int GL_BLEND_EQUATION_RGB = 0x8009; + public static final int GL_BLEND_EQUATION_ALPHA = 0x883D; + + public static native void glBlendEquationSeparate(int modeRGB, int modeAlpha); } \ No newline at end of file |
|
From: Elias N. <eli...@us...> - 2005-01-15 16:30:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20452/src/java/org/lwjgl Modified Files: Sys.java Log Message: Don't allow null strings in Sys.alert() Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- Sys.java 14 Dec 2004 12:54:25 -0000 1.65 +++ Sys.java 15 Jan 2005 16:30:17 -0000 1.66 @@ -210,6 +210,10 @@ if (grabbed) { Mouse.setGrabbed(false); } + if (title == null) + title = ""; + if (message == null) + message = ""; String osName = System.getProperty("os.name"); if (osName.startsWith("Windows")) { nAlert(title, message); |
|
From: Elias N. <eli...@us...> - 2005-01-15 15:46:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11105/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Win32: Fix Pbuffer.getPbufferCaps() Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_Display.c 14 Jan 2005 11:20:04 -0000 1.3 +++ org_lwjgl_opengl_Display.c 15 Jan 2005 15:45:54 -0000 1.4 @@ -660,7 +660,6 @@ return; } - extgl_InitWGL(env); ShowWindow(display_hwnd, SW_SHOW); UpdateWindow(display_hwnd); SetForegroundWindow(display_hwnd); @@ -725,9 +724,17 @@ } arb_context = wglCreateContext(arb_hdc); closeWindow(arb_hwnd, arb_hdc); + if (arb_context == NULL) { + return false; + } + if (!wglMakeCurrent(arb_hdc, arb_context)) { + wglDeleteContext(arb_context); + return false; + } + extgl_InitWGL(env); *pixel_format_index_return = pixel_format_index; *context_return = arb_context; - return true; + return; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createContext(JNIEnv *env, jobject self, jobject pixel_format) { |
|
From: Elias N. <eli...@us...> - 2005-01-14 13:57:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7922/src/native/win32 Modified Files: org_lwjgl_opengl_Pbuffer.c Log Message: Win32: Fix pbuffer context sharing Index: org_lwjgl_opengl_Pbuffer.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_Pbuffer.c 11 Jan 2005 14:05:14 -0000 1.3 +++ org_lwjgl_opengl_Pbuffer.c 14 Jan 2005 13:56:51 -0000 1.4 @@ -131,7 +131,7 @@ throwException(env, "Failed to create Pbuffer rendering context"); return NULL; } - if (getCurrentContext() != NULL && !wglShareLists(shared_context, Pbuffer_context)) { + if (shared_context != NULL && !wglShareLists(shared_context, Pbuffer_context)) { wglDeleteContext(Pbuffer_context); throwException(env, "Could not share buffer context."); return NULL; @@ -174,7 +174,7 @@ } shared_context = getCurrentContext(); if (shared_context_handle_buffer != NULL) { - Pbuffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, buffer_handle); + Pbuffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, shared_context_handle_buffer); shared_context = Pbuffer_info->Pbuffer_context; } Pbuffer_context = createPbufferContext(env, Pbuffer_dc, shared_context); |
|
From: Elias N. <eli...@us...> - 2005-01-14 13:30:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2406 Modified Files: org_lwjgl_opengl_Pbuffer.c Log Message: Linux: Don't free Pbuffer when it is not created Index: org_lwjgl_opengl_Pbuffer.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_opengl_Pbuffer.c 12 Jan 2005 12:20:53 -0000 1.5 +++ org_lwjgl_opengl_Pbuffer.c 14 Jan 2005 13:30:41 -0000 1.6 @@ -152,7 +152,9 @@ PbufferInfo *buffer_info = (PbufferInfo *)(*env)->GetDirectBufferAddress(env, handle_buffer); bool result; result = createPbufferUsingUniqueContext(env, buffer_info, pixel_format, width, height, buffer_attribs, shared_context); - if (!result || !checkXError(env)) { + if (!result) + return; + if (!checkXError(env)) { decDisplay(); destroyPbuffer(buffer_info); return; |
|
From: Elias N. <eli...@us...> - 2005-01-14 12:29:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19863/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Don't set the window location twice in Display.createWindow() Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Display.java 14 Jan 2005 09:39:22 -0000 1.40 +++ Display.java 14 Jan 2005 12:29:19 -0000 1.41 @@ -201,13 +201,23 @@ * A native context must exist, and it will be attached to the window. */ private static void createWindow() throws LWJGLException { - display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y); - makeCurrent(); - // if no display location set, center window - if(x == -1 && y == -1) { - setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2), - Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2)); + int window_x; + int window_y; + if (!fullscreen) { + // if no display location set, center window + if (x == -1 && y == -1) { + window_x = Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2); + window_y = Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2); + } else { + window_x = x; + window_y = y; + } + } else { + window_x = 0; + window_y = 0; } + display_impl.createWindow(current_mode, fullscreen, window_x, window_y); + makeCurrent(); setTitle(title); initControls(); |
|
From: Elias N. <eli...@us...> - 2005-01-14 11:20:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5265/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Win32: Fix native crash when no suitable pixel format is found. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_opengl_Display.c 14 Jan 2005 09:24:59 -0000 1.2 +++ org_lwjgl_opengl_Display.c 14 Jan 2005 11:20:04 -0000 1.3 @@ -203,36 +203,35 @@ 0, // reserved 0, 0, 0 // layer masks ignored }; - // get the best available match of pixel format for the device context iPixelFormat = ChoosePixelFormat(hdc, &pfd); if (iPixelFormat == 0) { - throwException(env, "Failed to choose pixel format"); + printfDebugJava(env, "Failed to choose pixel format"); return -1; } if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) { - throwException(env, "Could not describe pixel format"); + printfDebugJava(env, "Could not describe pixel format"); return -1; } if (desc.cColorBits < bpp) { - throwException(env, "This application requires a greater colour depth"); + printfDebugJava(env, "Insufficient color precision"); return -1; } if (desc.cAlphaBits < alpha) { - throwException(env, "This application requires a greater alpha depth"); + printfDebugJava(env, "Insufficient alpha precision"); return -1; } if (desc.cStencilBits < stencil) { - throwException(env, "This application requires a greater stencil depth"); + printfDebugJava(env, "Insufficient stencil precision"); return -1; } if (desc.cDepthBits < depth) { - throwException(env, "This application requires a greater depth buffer depth"); + printfDebugJava(env, "Insufficient depth buffer precision"); return -1; } @@ -240,13 +239,13 @@ jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Window.allowSoftwareOpenGL"); // secondary check for software override if(!allowSoftwareOpenGL) { - throwException(env, "Mode not supported by hardware"); + printfDebugJava(env, "Pixel format not accelerated"); return -1; } } if ((desc.dwFlags & flags) != flags) { - throwException(env, "Capabilities not supported"); + printfDebugJava(env, "Capabilities not supported"); return -1; } @@ -255,8 +254,8 @@ int findPixelFormat(JNIEnv *env, HDC hdc, jobject pixel_format) { int bpp = GetDeviceCaps(hdc, BITSPIXEL); - jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); - int iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp); + int iPixelFormat; + iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp); if (iPixelFormat == -1) { return findPixelFormatFromBPP(env, hdc, pixel_format, 16); } else @@ -510,7 +509,6 @@ FALSE, // menu-present option exstyle // extended window style ); - // Create the window now, using that class: new_hwnd = CreateWindowEx ( exstyle, @@ -733,7 +731,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createContext(JNIEnv *env, jobject self, jobject pixel_format) { - HWND dummy_hwnd = createWindow(0, 0, 1, 1, false, false); + HWND dummy_hwnd; HDC dummy_hdc; BOOL result; jclass cls_pixel_format; @@ -741,6 +739,7 @@ int pixel_format_index_arb; HGLRC context_arb; bool arb_success; + dummy_hwnd = createWindow(0, 0, 1, 1, false, false); if (dummy_hwnd == NULL) { throwException(env, "Failed to create the window."); return; |
|
From: Elias N. <eli...@us...> - 2005-01-14 10:01:51
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21047/platform_build/win32_ms_cmdline Modified Files: build.bat Log Message: Win32 build: Removed redundant libraries from linker option Index: build.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build.bat,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- build.bat 13 Dec 2004 17:05:50 -0000 1.10 +++ build.bat 14 Jan 2005 10:01:38 -0000 1.11 @@ -8,7 +8,7 @@ if "%DXHOME%" == "" goto errordxhome set COPTIONS=/I"%DXHOME%\include" /I"%CHOME%\include" /I"%PLTSDKHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"%ALHOME%\include" /I"%EAXHOME%\include" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W0 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" set LINKEROPTS=/link /LIBPATH:"%ALHOME%\libs" /LIBPATH:"%EAXHOME%\Libs" /LIBPATH:"%DXHOME%\Lib" /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL -set LIBS=dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib +set LIBS=dinput.lib dxguid.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib for %%x in (..\..\src\native\win32\*.c) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*.c) do cl %COPTIONS% %%x |
|
From: Elias N. <eli...@us...> - 2005-01-14 09:39:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16506/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Removed redundant makeCurrent from Display.java Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- Display.java 14 Jan 2005 09:24:58 -0000 1.39 +++ Display.java 14 Jan 2005 09:39:22 -0000 1.40 @@ -528,7 +528,6 @@ try { context = new Display(); createWindow(); - makeCurrent(); initContext(); } catch (LWJGLException e) { display_impl.destroyContext(); |
|
From: Elias N. <eli...@us...> - 2005-01-14 09:25:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13913/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Don't make context current in DisplayImplementation.createWindow(), but let Display do it explicitly to increase native call granularity Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_Display.c 9 Dec 2004 15:36:13 -0000 1.1 +++ org_lwjgl_opengl_Display.c 14 Jan 2005 09:24:59 -0000 1.2 @@ -662,12 +662,6 @@ return; } - result = wglMakeCurrent(display_hdc, display_hglrc); - if (!result) { - throwException(env, "Could not bind context to window"); - closeWindow(display_hwnd, display_hdc); - return; - } extgl_InitWGL(env); ShowWindow(display_hwnd, SW_SHOW); UpdateWindow(display_hwnd); |
|
From: Elias N. <eli...@us...> - 2005-01-14 09:25:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13913/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Don't make context current in DisplayImplementation.createWindow(), but let Display do it explicitly to increase native call granularity Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Display.java 10 Jan 2005 08:19:27 -0000 1.38 +++ Display.java 14 Jan 2005 09:24:58 -0000 1.39 @@ -202,12 +202,13 @@ */ private static void createWindow() throws LWJGLException { display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y); + makeCurrent(); // if no display location set, center window if(x == -1 && y == -1) { setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2), Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2)); } - + setTitle(title); initControls(); setVSyncEnabled(vsync); |
|
From: Ioannis T. <sp...@us...> - 2005-01-13 20:34:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23765 Removed Files: VBOTracker.java Log Message: VBOTracker renamed to BufferObjectTracker --- VBOTracker.java DELETED --- |
|
From: Ioannis T. <sp...@us...> - 2005-01-13 20:33:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23171 Modified Files: ARBBufferObject.java ARBImaging.java ARBTextureCompression.java GL11.java GL12.java GL13.java GL15.java GLBufferChecks.java GLContext.java Added Files: BufferObjectTracker.java Log Message: Finished PBO support implementation Index: ARBTextureCompression.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ARBTextureCompression.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ARBTextureCompression.java 25 Nov 2004 22:20:43 -0000 1.11 +++ ARBTextureCompression.java 13 Jan 2005 20:32:30 -0000 1.12 @@ -59,152 +59,208 @@ static native void initNativeStubs() throws LWJGLException; + // --------------------------- public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position()); } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexImage1DARBBO(target, level, internalformat, width, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexImage1DARBBO(int target, int level, int internalformat, int width, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position()); } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexImage2DARBBO(target, level, internalformat, width, height, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexImage2DARBBO(int target, int level, int internalformat, int width, int height, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position()); } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexImage3DARBBO(target, level, internalformat, width, height, depth, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexImage3DARBBO(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position()); } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage1DARB(target, level, xoffset, width, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexSubImage1DARBBO(target, level, xoffset, width, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexSubImage1DARBBO(int target, int level, int xoffset, int width, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position()); } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexSubImage2DARBBO(target, level, xoffset, yoffset, width, height, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexSubImage2DARBBO(int target, int level, int xoffset, int yoffset, int width, int height, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ByteBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position()); } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, ShortBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 1); } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, IntBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 2); } - public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, FloatBuffer pData) { + GLBufferChecks.ensureUnpackPBOdisabled(); BufferChecks.checkDirect(pData); nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, pData, pData.position() << 2); } - private static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, Buffer pData, int pData_offset); + public static void glCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, int buffer_offset) { + GLBufferChecks.ensureUnpackPBOenabled(); + nglCompressedTexSubImage3DARBBO(target, level, xoffset, yoffset, zoffset, width, height, depth, border, imageSize, buffer_offset); + } + private static native void nglCompressedTexSubImage3DARBBO(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int border, int imageSize, int buffer_offset); + // --------------------------- + + // --------------------------- public static void glGetCompressedTexImageARB(int target, int lod, ByteBuffer pImg) { + GLBufferChecks.ensurePackPBOdisabled(); BufferChecks.checkDirect(pImg); nglGetCompressedTexImageARB(target, lod, pImg, pImg.position()); } - public static void glGetCompressedTexImageARB(int target, int lod, ShortBuffer pImg) { + GLBufferChecks.ensurePackPBOdisabled(); BufferChecks.checkDirect(pImg); nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 1); } - public static void glGetCompressedTexImageARB(int target, int lod, IntBuffer pImg) { + GLBufferChecks.ensurePackPBOdisabled(); BufferChecks.checkDirect(pImg); nglGetCompressedTexImageARB(target, lod, pImg, pImg.position() << 2); } - private static native void nglGetCompressedTexImageARB(int target, int lod, Buffer pImg, int pImg_offset); + + public static void glGetCompressedTexImageARB(int target, int lod, int buffer_offset) { + GLBufferChecks.ensurePackPBOenabled(); + nglGetCompressedTexImageARBBO(target, lod, buffer_offset); + } + private static native void nglGetCompressedTexImageARBBO(int target, int lod, int buffer_offset); + // --------------------------- } --- NEW FILE: BufferObjectTracker.java --- /* * 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 java.util.WeakHashMap; import java.util.Map; /** Track Vertex Buffer Objects by context. */ final class BufferObjectTracker { private static BufferObjectTracker current_tracker; private static final Map contextToTracker = new WeakHashMap(3, 1.0f); private final StateStack vbo_array_stack; private final StateStack vbo_element_stack; private final StateStack pbo_pack_stack; private final StateStack pbo_unpack_stack; private final StateStack attrib_stack; private BufferObjectTracker() { int stack_size = Math.max(1, Util.glGetInteger(GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH)); vbo_array_stack = new StateStack(stack_size, 0); vbo_element_stack = new StateStack(stack_size, 0); pbo_pack_stack = new StateStack(stack_size, 0); pbo_unpack_stack = new StateStack(stack_size, 0); attrib_stack = new StateStack(stack_size, 0); } static StateStack getVBOArrayStack() { return current_tracker.vbo_array_stack; } static StateStack getVBOElementStack() { return current_tracker.vbo_element_stack; } static StateStack getPBOPackStack() { return current_tracker.pbo_pack_stack; } static StateStack getPBOUnpackStack() { return current_tracker.pbo_unpack_stack; } static StateStack getClientAttribStack() { return current_tracker.attrib_stack; } /** * Called after a GLContext has been made current. This will set up the current VBO tracker. * * @param context */ static void setCurrent(Object context) { if ( context == null ) { current_tracker = null; return; } current_tracker = (BufferObjectTracker)contextToTracker.get(context); if ( current_tracker == null ) { current_tracker = new BufferObjectTracker(); contextToTracker.put(context, current_tracker); } } } Index: GL11.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL11.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- GL11.java 13 Jan 2005 02:14:44 -0000 1.23 +++ GL11.java 13 Jan 2005 20:32:30 -0000 1.24 @@ -1426,24 +1426,24 @@ public static native void glPopMatrix(); public static void glPushClientAttrib(int mask) { - VBOTracker.getClientAttribStack().pushState(); - VBOTracker.getClientAttribStack().setState(mask); + BufferObjectTracker.getClientAttribStack().pushState(); + BufferObjectTracker.getClientAttribStack().setState(mask); if ((mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) { - VBOTracker.getVBOArrayStack().pushState(); - VBOTracker.getVBOElementStack().pushState(); - VBOTracker.getPBOPackStack().pushState(); - VBOTracker.getPBOUnpackStack().pushState(); + BufferObjectTracker.getVBOArrayStack().pushState(); + BufferObjectTracker.getVBOElementStack().pushState(); + BufferObjectTracker.getPBOPackStack().pushState(); + BufferObjectTracker.getPBOUnpackStack().pushState(); } nglPushClientAttrib(mask); } private static native void nglPushClientAttrib(int mask); public static void glPopClientAttrib() { - if ((VBOTracker.getClientAttribStack().popState() & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) { - VBOTracker.getVBOArrayStack().popState(); - VBOTracker.getVBOElementStack().popState(); - VBOTracker.getPBOPackStack().popState(); - VBOTracker.getPBOUnpackStack().popState(); + if ((BufferObjectTracker.getClientAttribStack().popState() & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) { + BufferObjectTracker.getVBOArrayStack().popState(); + BufferObjectTracker.getVBOElementStack().popState(); + BufferObjectTracker.getPBOPackStack().popState(); + BufferObjectTracker.getPBOUnpackStack().popState(); } nglPopClientAttrib(); } Index: GL15.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL15.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- GL15.java 9 Sep 2004 23:48:50 -0000 1.12 +++ GL15.java 13 Jan 2005 20:32:31 -0000 1.13 @@ -82,10 +82,10 @@ public static void glBindBuffer(int target, int buffer) { switch ( target ) { case GL_ELEMENT_ARRAY_BUFFER: - VBOTracker.getVBOElementStack().setState(buffer); + BufferObjectTracker.getVBOElementStack().setState(buffer); break; case GL_ARRAY_BUFFER: - VBOTracker.getVBOArrayStack().setState(buffer); + BufferObjectTracker.getVBOArrayStack().setState(buffer); break; default: throw new IllegalArgumentException("Unsupported VBO target " + target); @@ -99,10 +99,10 @@ BufferChecks.checkDirect(buffers); for ( int i = buffers.position(); i < buffers.limit(); i++ ) { int buffer_handle = buffers.get(i); - if ( VBOTracker.getVBOElementStack().getState() == buffer_handle ) - VBOTracker.getVBOElementStack().setState(0); - if ( VBOTracker.getVBOArrayStack().getState() == buffer_handle ) - VBOTracker.getVBOArrayStack().setState(0); + if ( BufferObjectTracker.getVBOElementStack().getState() == buffer_handle ) + BufferObjectTracker.getVBOElementStack().setState(0); + if ( BufferObjectTracker.getVBOArrayStack().getState() == buffer_handle ) + BufferObjectTracker.getVBOArrayStack().setState(0); } nglDeleteBuffers(buffers.remaining(), buffers, buffers.position()); } Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- GLContext.java 12 Jan 2005 08:58:41 -0000 1.36 +++ GLContext.java 13 Jan 2005 20:32:31 -0000 1.37 @@ -243,7 +243,7 @@ if ( did_auto_load ) unloadOpenGLLibrary(); currentContext = null; - VBOTracker.setCurrent(null); + BufferObjectTracker.setCurrent(null); return; } // Is this the same as last time? @@ -261,7 +261,7 @@ try { loadStubs(); currentContext = new WeakReference(context); - VBOTracker.setCurrent(context); + BufferObjectTracker.setCurrent(context); } catch (LWJGLException e) { if ( did_auto_load ) unloadOpenGLLibrary(); Index: ARBBufferObject.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ARBBufferObject.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ARBBufferObject.java 13 Jan 2005 02:14:44 -0000 1.10 +++ ARBBufferObject.java 13 Jan 2005 20:32:30 -0000 1.11 @@ -72,16 +72,16 @@ public static void glBindBufferARB(int target, int buffer) { switch ( target ) { case ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB: - VBOTracker.getVBOArrayStack().setState(buffer); + BufferObjectTracker.getVBOArrayStack().setState(buffer); break; case ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB: - VBOTracker.getVBOElementStack().setState(buffer); + BufferObjectTracker.getVBOElementStack().setState(buffer); break; case ARBPixelBufferObject.GL_PIXEL_PACK_BUFFER_ARB: - VBOTracker.getPBOPackStack().setState(buffer); + BufferObjectTracker.getPBOPackStack().setState(buffer); break; case ARBPixelBufferObject.GL_PIXEL_UNPACK_BUFFER_ARB: - VBOTracker.getPBOUnpackStack().setState(buffer); + BufferObjectTracker.getPBOUnpackStack().setState(buffer); break; default: throw new IllegalArgumentException("Unsupported VBO target " + target); @@ -94,14 +94,14 @@ public static void glDeleteBuffersARB(IntBuffer buffers) { for ( int i = buffers.position(); i < buffers.limit(); i++ ) { int buffer_handle = buffers.get(i); - if ( VBOTracker.getVBOArrayStack().getState() == buffer_handle ) - VBOTracker.getVBOArrayStack().setState(0); - if ( VBOTracker.getVBOElementStack().getState() == buffer_handle ) - VBOTracker.getVBOElementStack().setState(0); - if ( VBOTracker.getPBOPackStack().getState() == buffer_handle ) - VBOTracker.getPBOPackStack().setState(0); - if ( VBOTracker.getPBOUnpackStack().getState() == buffer_handle ) - VBOTracker.getPBOUnpackStack().setState(0); + if ( BufferObjectTracker.getVBOArrayStack().getState() == buffer_handle ) + BufferObjectTracker.getVBOArrayStack().setState(0); + if ( BufferObjectTracker.getVBOElementStack().getState() == buffer_handle ) + BufferObjectTracker.getVBOElementStack().setState(0); + if ( BufferObjectTracker.getPBOPackStack().getState() == buffer_handle ) + BufferObjectTracker.getPBOPackStack().setState(0); + if ( BufferObjectTracker.getPBOUnpackStack().getState() == buffer_handle ) + BufferObjectTracker.getPBOUnpackStack().setState(0); } BufferChecks.checkDirect(buffers); nglDeleteBuffersARB(buffers.remaining(), buffers, buffers.position()); Index: GLBufferChecks.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLBufferChecks.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GLBufferChecks.java 13 Jan 2005 02:14:45 -0000 1.5 +++ GLBufferChecks.java 13 Jan 2005 20:32:31 -0000 1.6 @@ -52,49 +52,49 @@ /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensureArrayVBOdisabled() { - if ( VBOTracker.getVBOArrayStack().getState() != 0 ) + if ( BufferObjectTracker.getVBOArrayStack().getState() != 0 ) throw new OpenGLException("Cannot use Buffers when Array Buffer Object is enabled"); } /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensureArrayVBOenabled() { - if ( VBOTracker.getVBOArrayStack().getState() == 0 ) + if ( BufferObjectTracker.getVBOArrayStack().getState() == 0 ) throw new OpenGLException("Cannot use offsets when Array Buffer Object is disabled"); } /** Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensureElementVBOdisabled() { - if ( VBOTracker.getVBOElementStack().getState() != 0 ) + if ( BufferObjectTracker.getVBOElementStack().getState() != 0 ) throw new OpenGLException("Cannot use Buffers when Element Array Buffer Object is enabled"); } /** Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensureElementVBOenabled() { - if ( VBOTracker.getVBOElementStack().getState() == 0 ) + if ( BufferObjectTracker.getVBOElementStack().getState() == 0 ) throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled"); } /** Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensurePackPBOdisabled() { - if ( VBOTracker.getPBOPackStack().getState() != 0 ) + if ( BufferObjectTracker.getPBOPackStack().getState() != 0 ) throw new OpenGLException("Cannot use Buffers when Pixel Pack Buffer Object is enabled"); } /** Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensurePackPBOenabled() { - if ( VBOTracker.getPBOPackStack().getState() == 0 ) + if ( BufferObjectTracker.getPBOPackStack().getState() == 0 ) throw new OpenGLException("Cannot use offsets when Pixel Pack Buffer Object is disabled"); } /** Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensureUnpackPBOdisabled() { - if ( VBOTracker.getPBOUnpackStack().getState() != 0 ) + if ( BufferObjectTracker.getPBOUnpackStack().getState() != 0 ) throw new OpenGLException("Cannot use Buffers when Pixel Unpack Buffer Object is enabled"); } /** Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensureUnpackPBOenabled() { - if ( VBOTracker.getPBOUnpackStack().getState() == 0 ) + if ( BufferObjectTracker.getPBOUnpackStack().getState() == 0 ) throw new OpenGLException("Cannot use offsets when Pixel Unpack Buffer Object is disabled"); } |