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
(1) |
|
2
(6) |
3
(8) |
4
(1) |
5
|
6
(6) |
7
(3) |
8
(2) |
|
9
|
10
|
11
|
12
|
13
(4) |
14
|
15
|
|
16
(12) |
17
(4) |
18
(1) |
19
(8) |
20
|
21
(12) |
22
(4) |
|
23
(4) |
24
(14) |
25
|
26
|
27
(20) |
28
(31) |
29
(3) |
|
30
(13) |
31
(1) |
|
|
|
|
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 23:01:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv23879/src/java/org/lwjgl Modified Files: Window.java Log Message: New Window class, and major changes to Display Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Window.java 27 Mar 2003 22:46:25 -0000 1.2 +++ Window.java 27 Mar 2003 23:01:14 -0000 1.3 @@ -27,7 +27,7 @@ } /** Whether we have a window already */ - private static boolean created; + private static Window currentWindow; /** The window's native data structure. On Win32 this is an HWND. */ private int handle; @@ -76,7 +76,7 @@ * @throws RuntimeException if you attempt to create more than one window at the same time */ protected Window(String title, int x, int y, int width, int height) { - if (created) + if (currentWindow != null) throw new RuntimeException("Only one LWJGL window may be instantiated at any one time."); this.title = title; this.x = x; @@ -84,7 +84,7 @@ this.width = width; this.height = height; - created = true; + currentWindow = this; } /** @@ -168,7 +168,7 @@ * Destroy the window. */ public final void destroy() { - created = false; + currentWindow = null; nDestroy(); } @@ -182,6 +182,13 @@ */ public final int getHandle() { return handle; + } + + /** + * @return true if a window has been created + */ + public static boolean isCreated() { + return currentWindow != null; } /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:54:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv20540/src/java/org/lwjgl/input Modified Files: Mouse.java Keyboard.java Log Message: New Window class, and major changes to Display Index: Mouse.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Mouse.java 24 Mar 2003 16:58:10 -0000 1.15 +++ Mouse.java 27 Mar 2003 22:54:41 -0000 1.16 @@ -32,8 +32,7 @@ package org.lwjgl.input; -import org.lwjgl.Display; -import org.lwjgl.Sys; +import org.lwjgl.*; /** * $Id$ @@ -102,7 +101,7 @@ public static void create() throws Exception { if (created) return; - if (!Display.isCreated()) + if (!Window.isCreated()) throw new Exception("The display has not yet been created."); if (!nCreate()) throw new Exception("The mouse could not be created."); Index: Keyboard.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Keyboard.java 11 Jan 2003 23:09:38 -0000 1.16 +++ Keyboard.java 27 Mar 2003 22:54:41 -0000 1.17 @@ -35,7 +35,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.lwjgl.Display; +import org.lwjgl.*; import org.lwjgl.Sys; /** @@ -249,7 +249,7 @@ public static void create() throws Exception { if (created) return; - if (!Display.isCreated()) + if (!Window.isCreated()) throw new Exception("The display has not yet been created."); if (!nCreate()) throw new Exception("The keyboard could not be created."); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:46:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv16223/src/java/org/lwjgl Modified Files: Window.java Log Message: New Window class, and major changes to Display Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Window.java 27 Mar 2003 22:32:48 -0000 1.1 +++ Window.java 27 Mar 2003 22:46:25 -0000 1.2 @@ -15,8 +15,7 @@ * cannot be changed * - the window may be closeable by the user or operating system, and may be minimized * by the user or operating system - * - the operating system may or may not allow more than one window to be constructed - * at any one time. There is no guarantee that all windows can be visible at once. + * - only one window may ever be open at once * - the operating system may or may not be able to do fullscreen or windowed windows. * * @author foo @@ -26,6 +25,9 @@ static { System.loadLibrary(Sys.getLibraryName()); } + + /** Whether we have a window already */ + private static boolean created; /** The window's native data structure. On Win32 this is an HWND. */ private int handle; @@ -63,18 +65,26 @@ * * In this abstract base class, no actual window peer is constructed. This should be * done in specialised derived classes. + * + * Only one Window can be constructed at a time; to create another Window you must + * first destroy() the first window. * * @param title The window's title * @param x, y, width, height The position and dimensions of the client area of * the window. The dimensions may be ignored if the window cannot be made non- * fullscreen. The position may be ignored in either case. + * @throws RuntimeException if you attempt to create more than one window at the same time */ protected Window(String title, int x, int y, int width, int height) { + if (created) + throw new RuntimeException("Only one LWJGL window may be instantiated at any one time."); this.title = title; this.x = x; this.y = y; this.width = width; this.height = height; + + created = true; } /** @@ -157,7 +167,15 @@ /** * Destroy the window. */ - public final native void destroy(); + public final void destroy() { + created = false; + nDestroy(); + } + + /** + * Natively destroy the window + */ + private native void nDestroy(); /** * @return the native window handle |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:36:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv10844/src/java/org/lwjgl Modified Files: Display.java Log Message: New Window class, and major changes to Display Index: Display.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:33:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv9078/src/java/org/lwjgl/test/input Modified Files: MouseCreationTest.java MouseTest.java ControllerCreationTest.java Log Message: New Window class, and major changes to Display Index: MouseCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MouseCreationTest.java 24 Mar 2003 17:07:25 -0000 1.5 +++ MouseCreationTest.java 27 Mar 2003 22:32:44 -0000 1.6 @@ -35,6 +35,7 @@ import org.lwjgl.Display; import org.lwjgl.DisplayMode; import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.*; import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLU; import org.lwjgl.vector.Vector2f; @@ -118,7 +119,7 @@ // recreate display in fullscreen mode System.out.print("Destroying display..."); - Display.destroy(); + BaseGL.destroy(); System.out.println("success"); System.out.print("Entering fullscreen mode..."); @@ -140,7 +141,7 @@ System.out.print("Shutting down..."); Mouse.destroy(); gl.destroy(); - Display.destroy(); + BaseGL.destroy(); System.out.println("shutdown complete"); } Index: MouseTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MouseTest.java 24 Mar 2003 17:07:25 -0000 1.7 +++ MouseTest.java 27 Mar 2003 22:32:45 -0000 1.8 @@ -35,6 +35,7 @@ import org.lwjgl.DisplayMode; import org.lwjgl.input.Mouse; import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.*; import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLU; import org.lwjgl.vector.Vector2f; @@ -118,7 +119,7 @@ Mouse.destroy(); Keyboard.destroy(); gl.destroy(); - Display.destroy(); + BaseGL.destroy(); } private void createMouse() { @@ -131,8 +132,8 @@ } private void wiggleMouse() { - while (!Display.isCloseRequested()) { - if(Display.isMinimized()) { + while (!BaseGL.isCloseRequested()) { + if(BaseGL.isMinimized()) { continue; } Index: ControllerCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ControllerCreationTest.java 19 Mar 2003 12:41:27 -0000 1.2 +++ ControllerCreationTest.java 27 Mar 2003 22:32:46 -0000 1.3 @@ -35,6 +35,7 @@ import org.lwjgl.Display; import org.lwjgl.DisplayMode; import org.lwjgl.input.Controller; +import org.lwjgl.opengl.*; import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLU; import org.lwjgl.vector.Vector2f; @@ -118,7 +119,7 @@ // recreate display in fullscreen mode System.out.print("Destroying display..."); - Display.destroy(); + BaseGL.destroy(); System.out.println("success"); System.out.print("Entering fullscreen mode..."); @@ -140,7 +141,7 @@ System.out.print("Shutting down..."); Controller.destroy(); gl.destroy(); - Display.destroy(); + BaseGL.destroy(); System.out.println("shutdown complete"); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:33:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv9078/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: New Window class, and major changes to Display Index: WindowCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WindowCreationTest.java 24 Mar 2003 17:16:42 -0000 1.1 +++ WindowCreationTest.java 27 Mar 2003 22:32:46 -0000 1.2 @@ -7,6 +7,7 @@ package org.lwjgl.test; import org.lwjgl.*; +import org.lwjgl.opengl.BaseGL; /** * @author Brian @@ -43,6 +44,6 @@ System.out.println("Display created"); - Display.destroy(); + BaseGL.destroy(); } } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:33:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv9078/src/java/org/lwjgl/opengl Modified Files: BaseGL.java Log Message: New Window class, and major changes to Display Index: BaseGL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- BaseGL.java 21 Mar 2003 17:05:55 -0000 1.9 +++ BaseGL.java 27 Mar 2003 22:32:39 -0000 1.10 @@ -190,4 +190,166 @@ && Thread.currentThread() == renderThread; } + /** + * Create a fullscreen display. If the display has already been created then this + * method is a no-op. + * + * Alpha, depth, and stencil will be 0 bits. + * + * @param title The title for the application + * @throws Exception if the window could not be created for any reason + * @see #destroy() + */ + public static void create(String title) throws Exception { + create(title, 0, 0, 0); + } + + /** + * Create a fullscreen display. If the display has already been created then this + * method is a no-op. + * + * @param title The title for the application + * @param alpha Minimun number of alpha bits on the display + * @param depth Minimun number of depth bits on the display + * @param stencil Minimun number of stencil bits on the display + * @throws Exception if the window could not be created for any reason + * @see #destroy() + */ + public static void create(String title, int alpha, int depth, int stencil) + throws Exception { + + if (Display.created) { + return; + } + + if (!nCreateFullscreen(title, alpha, depth, stencil)) { + throw new Exception("Failed to create fullscreen display."); + } + + Display.created = true; + } + + /** + * Create a windowed display. If the display has already been created then this + * method is a no-op. + * + * The window is not guaranteed to be positioned at (x, y). Nor is it guaranteed + * to have a drag bar, title bar, close button, or minimized button. It cannot be + * resized once created. + * + * The window will have 0 bits alpha, depth, and stencil. + * + * @param title The title for the application + * @param x, y The position of the window + * @param width, height The dimensions of the drawable area of the window + * @throws Exception if the window could not be created for any reason + * @see #destroy() + */ + public static void create(String title, int x, int y, int width, int height) + throws Exception { + + create(title, x, y, width, height, 0, 0, 0); + + } + + /** + * Create a windowed display. If the display has already been created then this + * method is a no-op. + * + * The window is not guaranteed to be positioned at (x, y). Nor is it guaranteed + * to have a drag bar, title bar, close button, or minimized button. It cannot be + * resized once created. + * + * @param title The title for the application + * @param x, y The position of the window + * @param width, height The dimensions of the drawable area of the window + * @param alpha Minimun number of alpha bits on the display + * @param depth Minimun number of depth bits on the display + * @param stencil Minimun number of stencil bits on the display + * @throws Exception if the window could not be created for any reason + * @see #destroy() + */ + public static void create(String title, int x, int y, int width, int height, int alpha, int depth, int stencil) + throws Exception { + + if (Display.created) { + return; + } + + if (!nCreateWindowed(title, x, y, width, height, alpha, depth, stencil)) { + throw new Exception("Failed to create windowed display."); + } + + Display.created = true; + } + + /** + * Native method to create the display. This will set the handle if it is + * successful. + * @return true if the display was successfully created + * @see #create(org.lwjgl.DisplayMode, boolean) + */ + private static native boolean nCreateWindowed( + String title, + int x, + int y, + int width, + int height, + int alpha_bits, + int depth_bits, + int stencil_bits); + + /** + * Native method to create the display. This will set the handle if it is + * successful. + * @return true if the display was successfully created + * @see #create(org.lwjgl.DisplayMode, boolean) + */ + private static native boolean nCreateFullscreen( + String title, + int alpha_bits, + int depth_bits, + int stencil_bits); + + /** + * Destroy the display and return it to normal. If the display has not yet + * been created no action is taken. + */ + public static void destroy() { + if (!Display.created) { + return; + } + + nDestroy(); + Display.created = false; + Display.mode = null; + } + + /** + * Native method to destroy the display. This will reset the handle. + */ + private static native void nDestroy(); + + /** + * Determines if the display is minimized. When the display is minimized it is + * effectively invisible, and you need perform no rendering in your game loop. + * On the native side, when the application is switched to some other application, + * the display window will minimize; when focus is regained, it will maximize and + * automatically gain focus and become the foreground window again. + * @return true if the display is minimized + */ + public static native boolean isMinimized(); + + /** + * Determines if the user has requested that the application should close. + * When a user has requested that the application should shutdown, it is up to + * the application to perform the actual shutdown and cleanup of any allocated + * resources. + * + * @return true if the user has requested that the application should close + */ + public static boolean isCloseRequested() { + return Display.closeRequested; + } + } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:33:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv9078/src/java/org/lwjgl/test/opengl Modified Files: Grass.java Game.java Log Message: New Window class, and major changes to Display Index: Grass.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Grass.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Grass.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Grass.java 19 Mar 2003 12:41:28 -0000 1.9 +++ Grass.java 27 Mar 2003 22:32:34 -0000 1.10 @@ -214,7 +214,7 @@ Mouse.destroy(); Keyboard.destroy(); gl.destroy(); - Display.destroy(); + BaseGL.destroy(); } private static float myrand() { Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Game.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Game.java 19 Mar 2003 12:41:28 -0000 1.10 +++ Game.java 27 Mar 2003 22:32:36 -0000 1.11 @@ -45,7 +45,7 @@ import org.lwjgl.opengl.*; import org.lwjgl.input.*; -import java.nio.*; +import java.nio.*; public final class Game { static { @@ -188,6 +188,6 @@ Keyboard.destroy(); Mouse.destroy(); gl.destroy(); - Display.destroy(); + BaseGL.destroy(); } } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-27 22:33:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv9078/src/java/org/lwjgl Modified Files: Display.java Added Files: Window.java Log Message: New Window class, and major changes to Display --- NEW FILE: Window.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java /* * Created on 27-Mar-2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.lwjgl; /** * This is the abstract base class for a Window in LWJGL. LWJGL windows have some * peculiar characteristics: * * - width and height are always fixed and cannot be changed * - the position of the window may or may not be programmable but once specified * cannot be changed * - the window may be closeable by the user or operating system, and may be minimized * by the user or operating system * - the operating system may or may not allow more than one window to be constructed * at any one time. There is no guarantee that all windows can be visible at once. * - the operating system may or may not be able to do fullscreen or windowed windows. * * @author foo */ public abstract class Window { static { System.loadLibrary(Sys.getLibraryName()); } /** The window's native data structure. On Win32 this is an HWND. */ private int handle; /** Whether the window is currently minimized */ private boolean minimized; /** Whether the window has been asked to close by the user or underlying OS */ private boolean closeRequested; /** Whether the window is dirty, ie. needs painting */ private boolean dirty; /** X coordinate of the window */ private int x; /** * Y coordinate of the window. Y in window coordinates is from the top of the display down, * unlike GL, where it is typically at the bottom of the display. */ private int y; /** Width of the window */ private final int width; /** Height of the window */ private final int height; /** Title of the window */ private String title; /** * Construct a Window. Some OSs may not support non-fullscreen windows; in * which case the window will be fullscreen regardless. * * In this abstract base class, no actual window peer is constructed. This should be * done in specialised derived classes. * * @param title The window's title * @param x, y, width, height The position and dimensions of the client area of * the window. The dimensions may be ignored if the window cannot be made non- * fullscreen. The position may be ignored in either case. */ protected Window(String title, int x, int y, int width, int height) { this.title = title; this.x = x; this.y = y; this.width = width; this.height = height; } /** * @return the width of the window */ public final int getWidth() { return width; } /** * @return the height of the window */ public final int getHeight() { return height; } /** * @return the title of the window */ public final String getTitle() { return title; } /** * Set the title of the window. This may be ignored by the underlying OS. * @param newTitle The new window title */ public final void setTitle(String newTitle) { title = newTitle; nSetTitle(); } /** * Native implementation of setTitle(). This will read the window's title member * and stash it in the native title of the window. */ private native void nSetTitle(); /** * @return true if the user or operating system has asked the window to close */ public final boolean isCloseRequested() { return closeRequested; } /** * @return true if the window is minimized or otherwise not visible */ public final boolean isMinimized() { return minimized; } /** * Determine if the window's contents have been damaged by external events. * If you are writing a straightforward game rendering loop and simply paint * every frame regardless, you can ignore this flag altogether. If you are * trying to be kind to other processes you can check this flag and only * redraw when it returns true. The flag is cleared when you call paint(). * * @return true if the window has been damaged by external changes * and needs to repaint itself */ public final boolean isDirty() { return dirty; } /** * Paint the window. This clears the dirty flag and swaps the buffers. */ public final void paint() { dirty = false; swapBuffers(); } /** * Swap the buffers. */ private native void swapBuffers(); /** * Destroy the window. */ public final native void destroy(); /** * @return the native window handle */ public final int getHandle() { return handle; } /** * 'Tick' the window. This must be called at least once per video frame * to handle window close requests, moves, paints, etc. */ public final native void tick(); } Index: Display.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Display.java 21 Mar 2003 17:05:55 -0000 1.19 +++ Display.java 27 Mar 2003 22:32:47 -0000 1.20 @@ -34,6 +34,7 @@ import java.util.HashSet; import java.util.Arrays; + /** * $Id$ * @@ -49,6 +50,7 @@ static { System.loadLibrary(Sys.getLibraryName()); + init(); } /** Has the display been created? */ @@ -83,6 +85,12 @@ private Display() { super(); } + + /** + * Initialize. This determines, natively, the current display mode and stashes + * it back in the mode static member. + */ + private static native void init(); /** * Returns the entire list of display modes as an array, in no @@ -116,89 +124,29 @@ /** * Native method for getting displaymodes */ - public static native DisplayMode[] nGetAvailableDisplayModes(); - + private static native DisplayMode[] nGetAvailableDisplayModes(); + /** - * Create a display with the specified display mode. If the display is - * already created then no action is taken - the display must first be - * destroyed. - * - * @param displayMode A display mode to choose - * @param alpha Minimun number of alpha bits on the display - * @param depth Minimun number of depth bits on the display - * @param stencil Minimun number of stencil bits on the display - * @param fullscreen Whether to create the display fullscreen - * @param title The title for the application + * Set the current display mode. The underlying OS may not use an exact match for + * the specified display mode. After successfully calling setDisplayMode() you will + * still need to query the display's characteristics using getDisplayMode(). + * @param newMode The new display mode to set * @throws Exception if the display mode could not be set - * @see #destroy() */ - public static void create(DisplayMode displayMode, int alpha, int depth, int stencil, boolean fullscreen, String title) - throws Exception { - - if (created) { - return; - } - - if (!nCreate(displayMode.width, - displayMode.height, - displayMode.bpp, - displayMode.freq, - alpha, - depth, - stencil, - fullscreen, - title)) { - throw new Exception("Failed to set display mode to " + displayMode); - } - - created = true; - mode = displayMode; - } - - /** - * Native method to create the display. This will set the handle if it is - * successful. - * @return true if the display was successfully created - * @see #create(org.lwjgl.DisplayMode, boolean) - */ - private static native boolean nCreate( - int width, - int height, - int bpp, - int freq, - int alpha_bits, - int depth_bits, - int stencil_bits, - boolean fullscreen, - String title); - - /** - * Destroy the display and return it to normal. If the display has not yet - * been created no action is taken. - */ - public static void destroy() { - if (!created) { - return; - } - - nDestroy(); - created = false; - mode = null; - } - + public static native void setDisplayMode(DisplayMode mode) throws Exception; + /** - * Native method to destroy the display. This will reset the handle. + * Reset the display mode to whatever it was when LWJGL was initialized. + * Fails silently. */ - private static native void nDestroy(); + public static native void resetDisplayMode() throws Exception; /** * Retrieves the width of the created display * * @return the current display width. - * @throws AssertionError if the display has not been created yet. */ public static int getWidth() { - assert created : "The display has not been created yet."; return mode.width; } @@ -206,10 +154,8 @@ * Retrieves the height of the created display * * @return the current display height. - * @throws AssertionError if the display has not been created yet. */ public static int getHeight() { - assert created : "The display has not been created yet."; return mode.height; } @@ -217,10 +163,8 @@ * Retrieves the current display depth of the created display * * @return the current display depth. - * @throws AssertionError if the display has not been created yet. */ public static int getDepth() { - assert created : "The display has not been created yet."; return mode.bpp; } @@ -228,27 +172,14 @@ * Retrieves the current display frequency of the created display * * @return the current display frequency. - * @throws AssertionError if the display has not been created yet. */ public static int getFrequency() { - assert created : "The display has not been created yet."; return mode.freq; } /** - * Retrieves the <code>DisplayMode</code> that the display has currently been - * set to. - * - * @return the current display mode, or null if the display is not yet created - * @throws AssertionError if the display has not been created yet. - */ - public static DisplayMode getDisplayMode() { - assert created : "The display has not been created yet."; - return mode; - } - - /** - * Retrieves the native handle to the created window + * Retrieves the native handle to the created window. The meaning of this value + * is platform specific. Under Win32, it is an HWND. * * @return the native handle * @throws AssertionError if the display has not been created yet. @@ -259,37 +190,6 @@ } /** - * Tests whether or not the display has been created - * - * @return true if the display has been created - */ - public static boolean isCreated() { - return created; - } - - /** - * Determines if the display is minimized. When the display is minimized it is - * effectively invisible, and you need perform no rendering in your game loop. - * On the native side, when the application is switched to some other application, - * the display window will minimize; when focus is regained, it will maximize and - * automatically gain focus and become the foreground window again. - * @return true if the display is minimized - */ - public static native boolean isMinimized(); - - /** - * Determines if the user has requested that the application should close. - * When a user has requested that the application should shutdown, it is up to - * the application to perform the actual shutdown and cleanup of any allocated - * resources. - * - * @return true if the user has requested that the application should close - */ - public static boolean isCloseRequested() { - return closeRequested; - } - - /** * Returns the operating system windowing platform. This will be one of the * constants defined above. There is no "unknown" platform; a native library port * has to provide a unique platform number for this mechanism to work. If the LWJGL @@ -299,5 +199,21 @@ */ public static native int getPlatform(); + /** + * Obtains the display's gamma ramp. The gamma ramp returned is an array of + * integers in the range 0..255. If gamma is not supported by the underlying + * hardware then null is returned. + * @return an array of ints, or null + */ + public static native int[] getGammaRamp(); + + /** + * Sets the display's gamma ramp. The gamma ramp should be an array of ints + * in the range 0...255. The length of the array should match the length of the + * array returned by getGammaRamp(). + * + * If the underlying hardware does not support gamma then this command is a no-op. + */ + public static native void setGammaRamp(int[] gamma); } |
|
From: Elias N. <eli...@us...> - 2003-03-27 18:28:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv28750/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Various linux fixes(alot) Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_opengl_BaseGL.cpp 27 Mar 2003 18:27:36 -0000 1.11 +++ org_lwjgl_opengl_BaseGL.cpp 27 Mar 2003 18:28:05 -0000 1.12 @@ -65,7 +65,6 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate (JNIEnv * env, jobject obj) { - printf("1\n"); if (disp == NULL) { #ifdef _DEBUG printf("No display\n"); @@ -78,9 +77,7 @@ #endif return JNI_FALSE; } - printf("2\n"); context = glXCreateContext(disp, getVisualInfo(), NULL, True); - printf("3\n"); if (context == NULL) { #ifdef _DEBUG printf("Could not create context\n"); @@ -88,9 +85,7 @@ return JNI_FALSE; } - printf("4\n"); makeCurrent(); - printf("5\n"); if (extgl_Initialize() != 0) { #ifdef _DEBUG printf("Could not init gl function pointers\n"); |
|
From: Elias N. <eli...@us...> - 2003-03-27 18:27:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv28256/linux Modified Files: org_lwjgl_Display.cpp org_lwjgl_opengl_BaseGL.cpp Log Message: Various linux fixes(alot) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- org_lwjgl_Display.cpp 27 Mar 2003 17:22:26 -0000 1.30 +++ org_lwjgl_Display.cpp 27 Mar 2003 18:27:35 -0000 1.31 @@ -279,6 +279,7 @@ } screen = DefaultScreen(disp); if (!loadGL(disp, screen)) { + XCloseDisplay(disp); #ifdef _DEBUG printf("Could not load GL libs\n"); #endif Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_opengl_BaseGL.cpp 27 Mar 2003 15:16:35 -0000 1.10 +++ org_lwjgl_opengl_BaseGL.cpp 27 Mar 2003 18:27:36 -0000 1.11 @@ -65,6 +65,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate (JNIEnv * env, jobject obj) { + printf("1\n"); if (disp == NULL) { #ifdef _DEBUG printf("No display\n"); @@ -77,7 +78,9 @@ #endif return JNI_FALSE; } + printf("2\n"); context = glXCreateContext(disp, getVisualInfo(), NULL, True); + printf("3\n"); if (context == NULL) { #ifdef _DEBUG printf("Could not create context\n"); @@ -85,7 +88,9 @@ return JNI_FALSE; } + printf("4\n"); makeCurrent(); + printf("5\n"); if (extgl_Initialize() != 0) { #ifdef _DEBUG printf("Could not init gl function pointers\n"); @@ -135,10 +140,10 @@ } /* - * * Class: org_lwjgl_opengl_BaseGL - * * Method: nFreeContext - * * Signature: ()V - * */ + * Class: org_lwjgl_opengl_BaseGL + * Method: nFreeContext + * Signature: ()V + */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nReleaseContext (JNIEnv *, jobject) { |
|
From: Elias N. <eli...@us...> - 2003-03-27 17:27:44
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory sc8-pr-cvs1:/tmp/cvs-serv1539/doc Modified Files: TODO Log Message: Index: TODO CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/TODO =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/doc/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 27 Mar 2003 16:25:54 -0000 1.1 +++ TODO 27 Mar 2003 17:27:26 -0000 1.2 @@ -3,22 +3,15 @@ 1. Apple extensions 2. Pbuffers - means opening up some internals like HDC and HWNDs that are meaningless to other operating systems but who cares... -3. Debug build: check for function availabilty macro and throw an OpenGL - exception instead of blowing up the VM 4. Javadoc for GL commands. For now why not just paste in the OpenGL man docs in there as they're in the public domain? If anyone complains we'll just have to sort something else out... 5. Change callback mechanism for GLUQuadrics to use an interface 6. Pbuffers for linux (and maybe macosx) - it's possible afaik -7. Check that returned modes really are hw accelerated. - (PFD_GENERIC_ACCELERATED, PFD_GENERIC_FORMAT) -8. The linux mouse behaviour hacks - at least the alt+tab hack. 9. Mode switching when alt+tabbing from fullscreen - if possible. -10. Maybe a flag to tell which platform you're on? Or sort out the - GL_NV_vertex_array_range allocation in a xplatform way. 11. OS X version 12. BSD Version? 13. Better documentation/tutorials 14. Better build system -15. 2D API \ No newline at end of file +15. 2D API |
|
From: Elias N. <eli...@us...> - 2003-03-27 17:22:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv31460/linux Modified Files: org_lwjgl_Display.cpp Log Message: Linux various (5) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- org_lwjgl_Display.cpp 27 Mar 2003 15:42:25 -0000 1.29 +++ org_lwjgl_Display.cpp 27 Mar 2003 17:22:26 -0000 1.30 @@ -348,6 +348,7 @@ #endif return JNI_FALSE; } + XF86VidModeLockModeSwitch(disp, screen, 1); break; } } @@ -363,6 +364,7 @@ setRepeatMode(AutoRepeatModeDefault); XDestroyWindow(disp, win); if (current_fullscreen) { + XF86VidModeLockModeSwitch(disp, screen, 0); if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[0])) { #ifdef _DEBUG printf("Could not switch mode\n"); |
|
From: Brian M. <ma...@us...> - 2003-03-27 16:26:01
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory sc8-pr-cvs1:/tmp/cvs-serv3871 Added Files: TODO Log Message: initial commit --- NEW FILE: TODO --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/TODO Todo: 1. Apple extensions 2. Pbuffers - means opening up some internals like HDC and HWNDs that are meaningless to other operating systems but who cares... 3. Debug build: check for function availabilty macro and throw an OpenGL exception instead of blowing up the VM 4. Javadoc for GL commands. For now why not just paste in the OpenGL man docs in there as they're in the public domain? If anyone complains we'll just have to sort something else out... 5. Change callback mechanism for GLUQuadrics to use an interface 6. Pbuffers for linux (and maybe macosx) - it's possible afaik 7. Check that returned modes really are hw accelerated. (PFD_GENERIC_ACCELERATED, PFD_GENERIC_FORMAT) 8. The linux mouse behaviour hacks - at least the alt+tab hack. 9. Mode switching when alt+tabbing from fullscreen - if possible. 10. Maybe a flag to tell which platform you're on? Or sort out the GL_NV_vertex_array_range allocation in a xplatform way. 11. OS X version 12. BSD Version? 13. Better documentation/tutorials 14. Better build system 15. 2D API |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:42:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv14142/linux Modified Files: org_lwjgl_Display.cpp Log Message: Various linux fixes(4) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- org_lwjgl_Display.cpp 27 Mar 2003 15:38:47 -0000 1.28 +++ org_lwjgl_Display.cpp 27 Mar 2003 15:42:25 -0000 1.29 @@ -375,7 +375,6 @@ vis_info = NULL; XCloseDisplay(disp); disp = NULL; - XSync(disp, False); closeGL(); #ifdef _DEBUG printf("Closed X connection\n"); |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:38:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv12366/linux Modified Files: org_lwjgl_Display.cpp Log Message: Various linux fixes(3) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- org_lwjgl_Display.cpp 27 Mar 2003 15:16:35 -0000 1.27 +++ org_lwjgl_Display.cpp 27 Mar 2003 15:38:47 -0000 1.28 @@ -293,7 +293,6 @@ } root_win = RootWindow(disp, screen); vis_info = chooseVisual(disp, screen, bpp, depth_bits, alpha_bits, stencil_bits); - XSync(disp, False); if (vis_info == NULL) { XCloseDisplay(disp); #ifdef _DEBUG @@ -376,6 +375,7 @@ vis_info = NULL; XCloseDisplay(disp); disp = NULL; + XSync(disp, False); closeGL(); #ifdef _DEBUG printf("Closed X connection\n"); |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:29:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv6618/common Modified Files: extgl.c Log Message: Various linux fixes(2) Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extgl.c 27 Mar 2003 15:16:34 -0000 1.8 +++ extgl.c 27 Mar 2003 15:28:57 -0000 1.9 @@ -3237,11 +3237,11 @@ #ifdef _X11 int extgl_Open(Display *disp, int screen) { - lib_gl_handle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL); + lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; - lib_glu_handle = dlopen("libGLU.so", RTLD_NOW | RTLD_GLOBAL); + lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; if (extgl_InitGLX(disp, screen) != 0) |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:16:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv32760/linux Modified Files: org_lwjgl_Display.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_opengl_BaseGL.cpp Log Message: Various linux fixes Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_Display.cpp 21 Mar 2003 23:28:00 -0000 1.26 +++ org_lwjgl_Display.cpp 27 Mar 2003 15:16:35 -0000 1.27 @@ -64,7 +64,6 @@ static XF86VidModeModeInfo **avail_modes; static XVisualInfo * vis_info; static Atom delete_atom; -static bool gl_loaded = false; static jclass saved_clazz; extern void handlePointerMotion(XMotionEvent *); @@ -83,70 +82,6 @@ int stencil; }; -/*static int fillFormat(struct pixelformat *formats, int index, int bpp, int depth, int alpha, int stencil) { - for (int i = 0; i < index; i++) - if (formats[i].bpp == bpp && - formats[i].depth == depth && - formats[i].alpha == alpha && - formats[i].stencil == stencil) - return 0; - formats[index].bpp = bpp; - formats[index].depth = depth; - formats[index].stencil = stencil; - formats[index].alpha = alpha; - return 1; -} - -static struct pixelformat *getGLXAvailablePixelFormats(Display *disp, int screen, int *length) { - if (extgl_Extensions.glx.GLX13 == 1) { - int num_formats; - int attriblist[] = {GLX_DOUBLEBUFFER, True, - GLX_STEREO, False, - GLX_RENDER_TYPE, GLX_RGBA_BIT, - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, - GLX_CONFIG_CAVEAT, GLX_NONE, - None}; - GLXFBConfig *configs = glXChooseFBConfig(disp, screen, attriblist, &num_formats); - struct pixelformat *formats = (struct pixelformat *)malloc(num_formats*sizeof(struct pixelformat)); - *length = 0; - for (int i = 0; i < num_formats; i++) { - int bpp, depth, alpha, stencil; - int val; - if (glXGetFBConfigAttrib(disp, configs[i], GLX_RED_SIZE, &val) != 0) { - ree(formats); - return NULL; - } - bpp = val; - if (glXGetFBConfigAttrib(disp, configs[i], GLX_GREEN_SIZE, &val) != 0) { - free(formats); - return NULL; - } - bpp += val; - if (glXGetFBConfigAttrib(disp, configs[i], GLX_BLUE_SIZE, &val) != 0) { - free(formats); - return NULL; - } - bpp += val; - if (glXGetFBConfigAttrib(disp, configs[i], GLX_ALPHA_SIZE, &alpha) != 0) { - free(formats); - return NULL; - } - if (glXGetFBConfigAttrib(disp, configs[i], GLX_DEPTH_SIZE, &depth) != 0) { - free(formats); - return NULL; - } - if (glXGetFBConfigAttrib(disp, configs[i], GLX_STENCIL_SIZE, &stencil) != 0) { - free(formats); - return NULL; - } - if (fillFormat(formats, *length, bpp, depth, alpha, stencil) == 1) - (*length)++; - } - return formats; - } - return NULL; -} -*/ static XVisualInfo *chooseVisual(Display *disp, int screen, int bpp, int depth, int alpha, int stencil) { int bpe; switch (bpp) { @@ -173,27 +108,16 @@ return glXChooseVisual(disp, screen, attriblist); } -/*static struct pixelformat *getAvailablePixelFormats(Display *disp, int screen, int *length) { - struct pixelformat *formats = getGLXAvailablePixelFormats(disp, screen, length); - if (formats != NULL) - return formats; - *length = 16; - formats = (struct pixelformat *)malloc((*length)*sizeof(struct pixelformat)); - *length = 0; - for (int bpp = 16; bpp <= 24; bpp += 8) - for (int depth = 16; depth <= 24; depth += 8) - for (int alpha = 0; alpha <= 8; alpha += 8) - for (int stencil = 0; stencil <= 8; stencil += 8) { - XVisualInfo * visual = chooseVisual(disp, screen, bpp, depth, alpha, stencil); - if (visual != NULL) { - if (fillFormat(formats, *length, bpp, depth, alpha, stencil) == 1) - (*length)++; - XFree(visual); - } - } - return formats; +static void dumpVisualInfo(Display *disp, XVisualInfo *vis_info) { + int alpha, depth, stencil, r, g, b; + glXGetConfig(disp, vis_info, GLX_RED_SIZE, &r); + glXGetConfig(disp, vis_info, GLX_GREEN_SIZE, &g); + glXGetConfig(disp, vis_info, GLX_BLUE_SIZE, &b); + glXGetConfig(disp, vis_info, GLX_ALPHA_SIZE, &alpha); + glXGetConfig(disp, vis_info, GLX_DEPTH_SIZE, &depth); + glXGetConfig(disp, vis_info, GLX_STENCIL_SIZE, &stencil); + printf("Pixel format chosen sizes: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d\n", r, g, b, alpha, depth, stencil); } -*/ static void waitMapped(Display *disp, Window win) { XEvent event; @@ -234,7 +158,7 @@ XNextEvent(disp, &event); switch (event.type) { case ClientMessage: - if ((event.xclient.format == 32) && (event.xclient.data.l[0] == delete_atom)) + if ((event.xclient.format == 32) && ((Atom)event.xclient.data.l[0] == delete_atom)) env->SetStaticBooleanField(saved_clazz, fid_close, JNI_TRUE); break; case FocusIn: @@ -264,20 +188,16 @@ } static bool loadGL(Display *disp, int screen) { - if (gl_loaded == true) - return true; if (extgl_Open(disp, screen) != 0) { #ifdef _DEBUG printf("Could not load gl libs\n"); #endif return false; } - gl_loaded = true; return true; } static void closeGL(void) { - gl_loaded = false; extgl_Close(); } @@ -373,6 +293,7 @@ } root_win = RootWindow(disp, screen); vis_info = chooseVisual(disp, screen, bpp, depth_bits, alpha_bits, stencil_bits); + XSync(disp, False); if (vis_info == NULL) { XCloseDisplay(disp); #ifdef _DEBUG @@ -380,7 +301,9 @@ #endif return JNI_FALSE; } - +#ifdef _DEBUG + dumpVisualInfo(disp, vis_info); +#endif cmap = XCreateColormap(disp, root_win, vis_info->visual, AllocNone); attribs.colormap = cmap; attribs.event_mask = FocusChangeMask | VisibilityChangeMask| StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; @@ -391,6 +314,7 @@ attribs.override_redirect = True; } win = XCreateWindow(disp, root_win, 0, 0, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); + XFreeColormap(disp, cmap); #ifdef _DEBUG printf("Created window\n"); #endif @@ -425,6 +349,7 @@ #endif return JNI_FALSE; } + break; } } XF86VidModeSetViewPort(disp, screen, 0, 0); @@ -446,8 +371,11 @@ } } XFree(avail_modes); + avail_modes = NULL; XFree(vis_info); + vis_info = NULL; XCloseDisplay(disp); + disp = NULL; closeGL(); #ifdef _DEBUG printf("Closed X connection\n"); @@ -479,13 +407,6 @@ screen = DefaultScreen(disp); int bpp = XDefaultDepth(disp, screen); - if (!loadGL(disp, screen)) { -#ifdef _DEBUG - printf("Could not load GL\n"); -#endif - XCloseDisplay(disp); - return NULL; - } if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { #ifdef _DEBUG printf("Could not get display modes\n"); @@ -493,22 +414,15 @@ XCloseDisplay(disp); return NULL; } - int num_pixelformats; -// struct pixelformat *formats = getAvailablePixelFormats(disp, screen, &num_pixelformats); // Allocate an array of DisplayModes big enough jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); - jobjectArray ret = env->NewObjectArray(num_modes/**num_pixelformats*/, displayModeClass, NULL); + jobjectArray ret = env->NewObjectArray(num_modes, displayModeClass, NULL); jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V"); for (i = 0; i < num_modes; i++) { -/* for (int j = 0; j < num_pixelformats; j++) { - jobject displayMode = env->NewObject(displayModeClass, displayModeConstructor, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay, formats[j].bpp, 0, formats[j].alpha, formats[j].depth, formats[j].stencil); - env->SetObjectArrayElement(ret, i*num_pixelformats + j, displayMode); - }*/ jobject displayMode = env->NewObject(displayModeClass, displayModeConstructor, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay, bpp, 0); env->SetObjectArrayElement(ret, i, displayMode); } -// free(formats); XFree(avail_modes); XCloseDisplay(disp); return ret; Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_input_Keyboard.cpp 21 Mar 2003 23:28:00 -0000 1.18 +++ org_lwjgl_input_Keyboard.cpp 27 Mar 2003 15:16:35 -0000 1.19 @@ -257,9 +257,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll (JNIEnv * env, jclass clazz, jint buf) { - XEvent event; - unsigned char state; - handleMessages(env); updateGrab(); memcpy((unsigned char*)buf, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); @@ -273,10 +270,8 @@ JNIEXPORT int JNICALL Java_org_lwjgl_input_Keyboard_nRead (JNIEnv * env, jclass clazz) { - XEvent event; XKeyEvent *key_event; int buf_count = 0; - int state; int num_events = 0; handleMessages(env); Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_opengl_BaseGL.cpp 21 Mar 2003 23:28:00 -0000 1.9 +++ org_lwjgl_opengl_BaseGL.cpp 27 Mar 2003 15:16:35 -0000 1.10 @@ -65,15 +65,20 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate (JNIEnv * env, jobject obj) { - - if (!getVisualInfo()) { + if (disp == NULL) { +#ifdef _DEBUG + printf("No display\n"); +#endif + return JNI_FALSE; + } + if (getVisualInfo() == NULL) { #ifdef _DEBUG printf("No visual info\n"); #endif return JNI_FALSE; } context = glXCreateContext(disp, getVisualInfo(), NULL, True); - if (!context) { + if (context == NULL) { #ifdef _DEBUG printf("Could not create context\n"); #endif @@ -103,9 +108,8 @@ (JNIEnv * env, jobject obj) { releaseContext(); - // Delete the rendering context - if (context != NULL) - glXDestroyContext(disp, context); + glXDestroyContext(disp, context); + context = NULL; } /* |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:16:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1:/tmp/cvs-serv32760 Modified Files: config.h.in configure.in Log Message: Various linux fixes Index: config.h.in CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/config.h.in =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/config.h.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- config.h.in 11 Dec 2002 07:16:31 -0000 1.2 +++ config.h.in 27 Mar 2003 15:16:33 -0000 1.3 @@ -6,9 +6,6 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the `openal' library (-lopenal). */ -#undef HAVE_LIBOPENAL - /* Define to 1 if you have the `X11' library (-lX11). */ #undef HAVE_LIBX11 Index: configure.in CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/configure.in =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/configure.in,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- configure.in 16 Mar 2003 21:55:43 -0000 1.9 +++ configure.in 27 Mar 2003 15:16:34 -0000 1.10 @@ -51,8 +51,8 @@ else AC_MSG_RESULT($JAVA_HOME) JAVA_HOME="$JAVA_HOME" - CPPFLAGS="$CPPFLAGS -D_X11 -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - CFLAGS="$CFLAGS -D_X11 -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CPPFLAGS="$CPPFLAGS -D_DEBUG -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CFLAGS="$CFLAGS -D_DEBUG -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" fi dnl Checks for libraries. @@ -64,8 +64,6 @@ AC_CHECK_LIB(Xext, main,, AC_MSG_ERROR(Xext is required)) dnl Replace `main' with a function in -lXxf86vm: AC_CHECK_LIB(Xxf86vm, main,, AC_MSG_ERROR(Xxf86vm is required)) -dnl Replace `main' with a function in -lopenal: -AC_CHECK_LIB(openal, main,, AC_MSG_ERROR(openal is required)) dnl Checks for header files. |
|
From: Elias N. <eli...@us...> - 2003-03-27 15:16:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv32760/common Modified Files: extgl.c Log Message: Various linux fixes Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- extgl.c 2 Jan 2003 05:44:16 -0000 1.7 +++ extgl.c 27 Mar 2003 15:16:34 -0000 1.8 @@ -2484,13 +2484,11 @@ return extgl_error; } -#ifdef _X11 void extgl_InitGLXSupportedExtensions(Display *disp, int screen) { extgl_Extensions.glx.EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info"); extgl_Extensions.glx.EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating"); } -#endif int extgl_InitGLX(Display *disp, int screen) { @@ -3239,11 +3237,11 @@ #ifdef _X11 int extgl_Open(Display *disp, int screen) { - lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); + lib_gl_handle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; - lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); + lib_glu_handle = dlopen("libGLU.so", RTLD_NOW | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; if (extgl_InitGLX(disp, screen) != 0) |