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) |
2
(8) |
3
(4) |
4
(6) |
5
(1) |
6
|
|
7
(8) |
8
|
9
(11) |
10
(5) |
11
(1) |
12
|
13
|
|
14
|
15
|
16
(3) |
17
(1) |
18
|
19
|
20
|
|
21
(1) |
22
(1) |
23
(2) |
24
|
25
(1) |
26
(11) |
27
|
|
28
(5) |
29
(5) |
30
(7) |
|
|
|
|
|
From: Elias N. <eli...@us...> - 2003-09-30 11:52:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv4887/src/native/win32 Modified Files: org_lwjgl_input_Controller.cpp org_lwjgl_input_Mouse.cpp Log Message: Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_input_Controller.cpp 30 Sep 2003 11:14:06 -0000 1.13 +++ org_lwjgl_input_Controller.cpp 30 Sep 2003 11:52:32 -0000 1.14 @@ -37,13 +37,15 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ + #define WIN32_LEAN_AND_MEAN #include "org_lwjgl_input_Controller.h" #include <windows.h> #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0500 -#include <dinput.h> +#include <dinput.h> +#include <Window.h> #define CONTROLLER_AXISMAX 1000 // Maxmimum range to which we'll gauge the swing #define CONTROLLER_AXISMIN -1000 // Minimum range to which we'll gauge the swing @@ -183,7 +185,6 @@ ShutdownController(); return; } - return cCreate_success ? JNI_TRUE : JNI_FALSE; } /* Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- org_lwjgl_input_Mouse.cpp 30 Sep 2003 11:14:06 -0000 1.28 +++ org_lwjgl_input_Mouse.cpp 30 Sep 2003 11:52:32 -0000 1.29 @@ -142,7 +142,6 @@ printf("Failed to acquire mouse\n"); #endif } - return mCreate_success ? JNI_TRUE : JNI_FALSE; } /* |
|
From: Elias N. <eli...@us...> - 2003-09-30 11:14:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv30485/linux Modified Files: org_lwjgl_input_Controller.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp Log Message: Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Controller.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Controller.cpp 7 Apr 2003 17:49:13 -0000 1.3 +++ org_lwjgl_input_Controller.cpp 30 Sep 2003 11:14:06 -0000 1.4 @@ -38,6 +38,7 @@ * @version $Revision$ */ #include <jni.h> +#include <Window.h> #include "org_lwjgl_input_Controller.h" /** @@ -49,8 +50,8 @@ /** * Called when the Controller instance is to be created */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { - return JNI_FALSE; +JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { + throwException(env, "Controller not implemented"); } /* 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.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_input_Keyboard.cpp 23 Aug 2003 09:47:58 -0000 1.26 +++ org_lwjgl_input_Keyboard.cpp 30 Sep 2003 11:14:06 -0000 1.27 @@ -131,7 +131,7 @@ * Method: nCreate * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { for (int i = 0; i < KEYBOARD_SIZE; i++) @@ -162,7 +162,6 @@ buffer_enabled = false; should_grab = true; updateGrab(); - return JNI_TRUE; } /* @@ -300,11 +299,10 @@ * Method: nEnableTranslation * Signature: ()I */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *env, jclass clazz) { translation_enabled = true; - return JNI_TRUE; } /* Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- org_lwjgl_input_Mouse.cpp 29 Aug 2003 08:00:44 -0000 1.32 +++ org_lwjgl_input_Mouse.cpp 30 Sep 2003 11:14:06 -0000 1.33 @@ -265,7 +265,7 @@ * Method: nCreate * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { int i; @@ -276,10 +276,8 @@ for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = JNI_FALSE; if (!blankCursor()) { -#ifdef _DEBUG - printf("Could not create blank cursor\n"); -#endif - return JNI_FALSE; + throwException(env, "Could not create blank cursor"); + return; } current_cursor = blank_cursor; native_cursor = false; @@ -288,7 +286,6 @@ pointer_grabbed = false; updateGrab(); loadXcursor(); - return JNI_TRUE; } /* |
|
From: Elias N. <eli...@us...> - 2003-09-30 11:14:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv30485/win32 Modified Files: org_lwjgl_input_Controller.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp Log Message: Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_input_Controller.cpp 16 May 2003 18:39:46 -0000 1.12 +++ org_lwjgl_input_Controller.cpp 30 Sep 2003 11:14:06 -0000 1.13 @@ -118,7 +118,7 @@ /** * Called when the Controller instance is to be created */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { // Create the DirectInput object. HRESULT hr; hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL); @@ -127,26 +127,22 @@ printf("DirectInputCreate failed\n"); #endif ShutdownController(); - return JNI_FALSE; + return; } /* Find all Controllers */ EnumerateControllers(); if (!cCreate_success) { -#if _DEBUG - printf("EnumerateControllers failed\n"); -#endif + throwException(env, "Failed to enumerate."); ShutdownController(); - return JNI_FALSE; + return; } /* check that we got at least 1 controller */ if (cDIDevice == NULL) { -#if _DEBUG - printf("No devices found during enumeration\n"); -#endif + throwException(env, "No devices found."); ShutdownController(); - return JNI_FALSE; + return; } //check for first time initialization - need to detect capabilities @@ -157,11 +153,9 @@ /* Enumerate capabilities of Controller */ EnumerateControllerCapabilities(); if (!cCreate_success) { -#if _DEBUG - printf("EnumerateControllerCapabilities failed\n"); -#endif + throwException(env, "Falied to enumerate capabilities."); ShutdownController(); - return JNI_FALSE; + return; } /* Do setup of Controller */ @@ -185,11 +179,9 @@ /* Aquire the Controller */ hr = cDIDevice->Acquire(); if(FAILED(hr)) { -#if _DEBUG - printf("Acquire failed\n"); -#endif + throwException(env, "Acquire failed"); ShutdownController(); - return JNI_FALSE; + return; } return cCreate_success ? JNI_TRUE : JNI_FALSE; } @@ -234,7 +226,7 @@ /** * Shutdown DI */ -void ShutdownController() { +static void ShutdownController() { // release device if (cDIDevice != NULL) { cDIDevice->Unacquire(); @@ -246,7 +238,7 @@ /** * Enumerates the capabilities of the Controller attached to the system */ -void EnumerateControllerCapabilities() { +static void EnumerateControllerCapabilities() { HRESULT hr; hr = cDIDevice->EnumObjects(EnumControllerObjectsCallback, NULL, DIDFT_ALL); if FAILED(hr) { @@ -262,7 +254,7 @@ /** * Enumerates the Controllers attached to the system */ -void EnumerateControllers() { +static void EnumerateControllers() { HRESULT hr; hr = cDI->EnumDevices(DIDEVTYPE_JOYSTICK, EnumControllerCallback, 0, DIEDFL_ATTACHEDONLY); if FAILED(hr) { @@ -322,7 +314,7 @@ /** * Creates the specified device as a Controller */ -void CreateController(LPCDIDEVICEINSTANCE lpddi) { +static void CreateController(LPCDIDEVICEINSTANCE lpddi) { HRESULT hr; hr = cDI->CreateDevice(lpddi->guidInstance, (LPDIRECTINPUTDEVICE*) &cDIDevice, NULL); if FAILED(hr) { @@ -338,7 +330,7 @@ /** * Sets up the Controller properties */ -void SetupController() { +static void SetupController() { // set Controller data format if(cDIDevice->SetDataFormat(&c_dfDIJoystick2) != DI_OK) { #if _DEBUG @@ -460,7 +452,7 @@ /** * Sets the fields on the Controller */ -void InitializeControllerFields() { +static void InitializeControllerFields() { //create buttons array jbooleanArray cButtonsArray = cEnvironment->NewBooleanArray(cButtoncount); @@ -471,7 +463,7 @@ /** * Updates the fields on the Controller */ -void UpdateControllerFields() { +static void UpdateControllerFields() { HRESULT hRes; // get data from the Controller @@ -543,7 +535,7 @@ /** * Sets the capabilities of the Controller */ -void SetControllerCapabilities() { +static void SetControllerCapabilities() { //set buttoncount cEnvironment->SetStaticIntField(clsController, fidCButtonCount, cButtoncount); @@ -567,7 +559,7 @@ /** * Caches the field ids for quicker access */ -void CacheControllerFields() { +static void CacheControllerFields() { fidCButtonCount = cEnvironment->GetStaticFieldID(clsController, "buttonCount", "I"); fidCHasXAxis = cEnvironment->GetStaticFieldID(clsController, "hasXAxis", "Z"); fidCHasRXAxis = cEnvironment->GetStaticFieldID(clsController, "hasRXAxis", "Z"); @@ -586,4 +578,4 @@ fidCRZ = cEnvironment->GetStaticFieldID(clsController, "rz", "I"); fidCPOV = cEnvironment->GetStaticFieldID(clsController, "pov", "I"); fidCSlider = cEnvironment->GetStaticFieldID(clsController, "slider", "I"); -} \ No newline at end of file +} Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- org_lwjgl_input_Keyboard.cpp 11 Sep 2003 08:00:28 -0000 1.23 +++ org_lwjgl_input_Keyboard.cpp 30 Sep 2003 11:14:06 -0000 1.24 @@ -80,38 +80,30 @@ * Method: nCreate * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { translationEnabled = false; // Check to see if we're already initialized if (lpdiKeyboard != NULL) { -#ifdef _DEBUG - printf("Keyboard already created.\n"); -#endif - return JNI_FALSE; + throwException(env, "Keyboard already created."); + return; } if (hwnd == NULL) { -#ifdef _DEBUG - printf("No window\n"); -#endif - return JNI_FALSE; + throwException(env, "No window."); + return; } // Create a keyboard device if (lpdi->CreateDevice(GUID_SysKeyboard, &lpdiKeyboard, NULL) != DI_OK) { -#ifdef _DEBUG - printf("Failed to create keyboard\n"); -#endif - return JNI_FALSE; + throwException(env, "Failed to create keyboard."); + return; } if (lpdiKeyboard->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { -#ifdef _DEBUG - printf("Failed to set keyboard cooperation mode\n"); -#endif - return JNI_FALSE; + throwException(env, "Failed to set keyboard cooperation mode."); + return; } // Tell 'em wot format to be in (the default "you are a mouse and keyboard" format) @@ -131,9 +123,6 @@ printf("Failed to acquire keyboard\n"); #endif } - - return JNI_TRUE; - } /* @@ -308,7 +297,7 @@ * Method: nEnableTranslation * Signature: ()V */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *, jclass) { // We can't do translation on DOS boxes it seems so we'll have to throw a wobbler @@ -318,13 +307,12 @@ osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { useUnicode = true; } else { useUnicode = false; } - translationEnabled = true; - return JNI_TRUE; + translationEnabled = true; } /* Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- org_lwjgl_input_Mouse.cpp 29 Aug 2003 08:00:44 -0000 1.27 +++ org_lwjgl_input_Mouse.cpp 30 Sep 2003 11:14:06 -0000 1.28 @@ -102,7 +102,7 @@ /** * Called when the Mouse instance is to be created */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { HRESULT hr; mEnvironment = env; @@ -120,11 +120,9 @@ /* Enumerate capabilities of Mouse */ EnumerateMouseCapabilities(); if (!mCreate_success) { -#if _DEBUG - printf("EnumerateMouseCapabilities failed\n"); -#endif + throwException(env, "Failed to enumerate."); ShutdownMouse(); - return JNI_FALSE; + return; } /* Do setup of Mouse */ SetupMouse(); @@ -171,9 +169,6 @@ throwException(env, "null device!"); mDIDevice->Unacquire(); if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { -#if _DEBUG - printf("SetCooperativeLevel failed\n"); -#endif throwException(env, "Could not set the CooperativeLevel."); return; } @@ -197,9 +192,6 @@ SetCursor(NULL); mDIDevice->Unacquire(); if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { -#if _DEBUG - printf("SetCooperativeLevel failed\n"); -#endif throwException(env, "Could not set the CooperativeLevel."); return; } |
|
From: Elias N. <eli...@us...> - 2003-09-30 10:52:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv26555/src/native/macosx Modified Files: org_lwjgl_input_Keyboard.cpp org_lwjgl_opengl_Window.cpp Log Message: boolean results -> Exceptions Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_input_Keyboard.cpp 1 Jan 2003 03:58:03 -0000 1.4 +++ org_lwjgl_input_Keyboard.cpp 30 Sep 2003 10:52:05 -0000 1.5 @@ -39,11 +39,11 @@ * @version $Revision$ */ -#include <Carbon/Carbon.h> -#include <assert.h> #include "org_lwjgl_input_Keyboard.h" -KeyMap keyMap; +#define KEYBOARD_BUFFER_SIZE 50 +#define KEYBOARD_SIZE 256 +#define KEY_EVENT_BACKLOG 40 /* * Class: org_lwjgl_input_Keyboard @@ -53,32 +53,16 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_initIDs (JNIEnv * env, jclass clazz) { - // Get a global class instance, just to be sure - static jobject globalClassLock = NULL; - - if (globalClassLock == NULL) { - globalClassLock = env->NewGlobalRef(clazz); - } - - //fid_readBuffer = env->GetStaticFieldID(clazz, "readBuffer", "Ljava/nio/ByteBuffer;"); - //fid_readBufferAddress = env->GetStaticFieldID(clazz, "readBufferAddress", "I"); } - /* * Class: org_lwjgl_input_Keyboard * Method: nCreate * Signature: ()Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { - -#ifdef _DEBUG - printf("Creating OSX Carbon keyboard interface\n"); -#endif - - return JNI_TRUE; } /* @@ -89,24 +73,16 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { - // no specific methodology for doing this in OSX input system -#ifdef _DEBUG - printf("Destroying OSX Carbon keyboard interface\n"); -#endif } - /* * Class: org_lwjgl_input_Keyboard * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll - (JNIEnv * env, jclass clazz, jint buf) + (JNIEnv * env, jclass clazz, jobject buffer) { - // get the keymap from the operating system's carbon layer - // - GetKeys( keyMap ); } /* @@ -114,10 +90,18 @@ * Method: nRead * Signature: (I)V */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead - (JNIEnv * env, jclass clazz, jint keys) +JNIEXPORT int JNICALL Java_org_lwjgl_input_Keyboard_nRead + (JNIEnv * env, jclass clazz) +{ + +/* + * Class: org_lwjgl_input_Keyboard + * Method: nEnableTranslation + * Signature: ()I + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation + (JNIEnv *env, jclass clazz) { - return 0; } /* @@ -128,7 +112,14 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nEnableBuffer (JNIEnv * env, jclass clazz) { - printf("Buffered input is currently not available\n"); - - return JNI_FALSE; +} + +/* + * Class: org_lwjgl_input_Keyboard + * Method: nisStateKeySet + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nisStateKeySet(JNIEnv *env, jclass clazz, jint key) +{ + return org_lwjgl_input_Keyboard_STATE_UNKNOWN; } Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_opengl_Window.cpp 29 Sep 2003 11:58:35 -0000 1.8 +++ org_lwjgl_opengl_Window.cpp 30 Sep 2003 10:52:05 -0000 1.9 @@ -73,24 +73,22 @@ } static pascal OSStatus doQuit(EventHandlerCallRef next_handler, EventRef event, void *user_data) { -printf("Close requested\n"); close_requested = true; return noErr; } static void registerEventHandlers(JNIEnv *env) { - EventTypeSpec event_type; + EventTypeSpec event_types[2]; OSStatus err; EventHandlerUPP handler_upp = NewEventHandlerUPP(doQuit); - event_type.eventClass = kEventClassWindow; - event_type.eventKind = kEventWindowClose; - err = InstallWindowEventHandler(win_ref, handler_upp, 1, &event_type, NULL, NULL); + event_types[0].eventClass = kEventClassWindow; + event_types[0].eventKind = kEventWindowClose; + err = InstallWindowEventHandler(win_ref, handler_upp, 1, event_types, NULL, NULL); + DisposeEventHandlerUPP(handler_upp); if (noErr != err) { - DisposeEventHandlerUPP(handler_upp); throwException(env, "Could not register window event handler"); return; } - DisposeEventHandlerUPP(handler_upp); } static void destroy(void) { @@ -125,7 +123,6 @@ throwException(env, "Could not create context"); return false; } - //if (aglSetFullScreen(context, 800, 600, 85, 0) == GL_FALSE) { if (aglSetDrawable(context, drawable) == GL_FALSE) { aglDestroyContext(context); throwException(env, "Could not attach context"); @@ -180,15 +177,21 @@ throwException(env, "Could not load gl function pointers"); return; } - TransitionWindow(win_ref, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL); + ShowWindow(win_ref); SelectWindow(win_ref); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_update (JNIEnv *env, jclass clazz) { + RunApplicationEventLoop(); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_swapBuffers(JNIEnv * env, jclass clazz) +{ aglSwapBuffers(context); } + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nDestroy (JNIEnv *env, jclass clazz) |
|
From: Elias N. <eli...@us...> - 2003-09-30 10:52:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv26555/src/native/common Modified Files: org_lwjgl_input_Controller.h org_lwjgl_input_Keyboard.h org_lwjgl_input_Mouse.h Log Message: boolean results -> Exceptions Index: org_lwjgl_input_Controller.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Controller.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Controller.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Controller.h 3 Jan 2003 18:47:42 -0000 1.1 +++ org_lwjgl_input_Controller.h 30 Sep 2003 10:52:05 -0000 1.2 @@ -11,9 +11,13 @@ /* Inaccessible static: created */ /* Inaccessible static: buttons */ /* Inaccessible static: x */ +/* Inaccessible static: rx */ /* Inaccessible static: y */ +/* Inaccessible static: ry */ /* Inaccessible static: z */ +/* Inaccessible static: rz */ /* Inaccessible static: pov */ +/* Inaccessible static: slider */ #undef org_lwjgl_input_Controller_POV_CENTER #define org_lwjgl_input_Controller_POV_CENTER -1L #undef org_lwjgl_input_Controller_POV_NORTH @@ -25,8 +29,17 @@ #undef org_lwjgl_input_Controller_POV_WEST #define org_lwjgl_input_Controller_POV_WEST 9000L /* Inaccessible static: buttonCount */ +/* Inaccessible static: hasXAxis */ +/* Inaccessible static: hasRXAxis */ +/* Inaccessible static: hasYAxis */ +/* Inaccessible static: hasRYAxis */ /* Inaccessible static: hasZAxis */ +/* Inaccessible static: hasRZAxis */ /* Inaccessible static: hasPOV */ +/* Inaccessible static: hasSlider */ +/* Inaccessible static: buttonName */ +/* Inaccessible static: buttonMap */ +/* Inaccessible static: initialized */ /* Inaccessible static: class_00024org_00024lwjgl_00024input_00024Controller */ /* * Class: org_lwjgl_input_Controller @@ -39,9 +52,9 @@ /* * Class: org_lwjgl_input_Controller * Method: nCreate - * Signature: ()Z + * Signature: ()V */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Controller_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate (JNIEnv *, jclass); /* Index: org_lwjgl_input_Keyboard.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Keyboard.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Keyboard.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_input_Keyboard.h 23 Aug 2003 09:45:22 -0000 1.6 +++ org_lwjgl_input_Keyboard.h 30 Sep 2003 10:52:05 -0000 1.7 @@ -276,8 +276,8 @@ /* Inaccessible static: character */ /* Inaccessible static: key */ /* Inaccessible static: state */ -/* Inaccessible static: class_000240 */ -/* Inaccessible static: class_000241 */ +/* Inaccessible static: initialized */ +/* Inaccessible static: class_00024org_00024lwjgl_00024input_00024Keyboard */ /* * Class: org_lwjgl_input_Keyboard * Method: initIDs @@ -289,9 +289,9 @@ /* * Class: org_lwjgl_input_Keyboard * Method: nCreate - * Signature: ()Z + * Signature: ()V */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv *, jclass); /* @@ -321,9 +321,9 @@ /* * Class: org_lwjgl_input_Keyboard * Method: nEnableTranslation - * Signature: ()Z + * Signature: ()V */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *, jclass); /* Index: org_lwjgl_input_Mouse.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_input_Mouse.h 29 Aug 2003 08:00:44 -0000 1.6 +++ org_lwjgl_input_Mouse.h 30 Sep 2003 10:52:05 -0000 1.7 @@ -24,6 +24,7 @@ /* Inaccessible static: currentCursor */ /* Inaccessible static: buttonName */ /* Inaccessible static: buttonMap */ +/* Inaccessible static: initialized */ /* Inaccessible static: class_00024org_00024lwjgl_00024input_00024Mouse */ /* * Class: org_lwjgl_input_Mouse @@ -68,9 +69,9 @@ /* * Class: org_lwjgl_input_Mouse * Method: nCreate - * Signature: ()Z + * Signature: ()V */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv *, jclass); /* |
|
From: Elias N. <eli...@us...> - 2003-09-30 10:52:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv26555/src/java/org/lwjgl/input Modified Files: Controller.java Keyboard.java Mouse.java Log Message: boolean results -> Exceptions Index: Controller.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Controller.java 16 Sep 2003 15:39:46 -0000 1.8 +++ Controller.java 30 Sep 2003 10:52:05 -0000 1.9 @@ -171,9 +171,7 @@ return; } - if (!nCreate()) { - throw new Exception("The controller could not be created."); - } + nCreate(); created = true; } @@ -248,10 +246,8 @@ /** * Native method to create the controller - * - * @return true if the controller was created */ - private static native boolean nCreate(); + private static native void nCreate() throws Exception; /** * Native method the destroy the controller 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.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Keyboard.java 10 Sep 2003 22:39:26 -0000 1.29 +++ Keyboard.java 30 Sep 2003 10:52:05 -0000 1.30 @@ -286,17 +286,14 @@ initialize(); if (created) return; - if (!nCreate()) - throw new Exception("The keyboard could not be created."); + nCreate(); created = true; } /** * Native method to create the keyboard - * - * @return true if the keyboard was created */ - private static native boolean nCreate(); + private static native void nCreate() throws Exception; /** * @return true if the keyboard has been created @@ -359,27 +356,26 @@ /** * Enable keyboard translation. Must be called after the keyboard is created, * and keyboard buffering must be enabled. - * @return false if translation cannot be enabled; true if it can */ - public static boolean enableTranslation() { + public static void enableTranslation() throws Exception { assert created : "The keyboard has not been created."; assert readBuffer != null : "Keyboard buffering has not been enabled."; - translationEnabled = nEnableTranslation(); - return translationEnabled; + nEnableTranslation(); + translationEnabled = true; } /** * Native method to enable the translation buffer */ - private static native boolean nEnableTranslation(); + private static native void nEnableTranslation() throws Exception; /** * Enable keyboard buffering. Must be called after the keyboard is created. * @return the size of the keyboard buffer in events, or 0 if no buffering * can be enabled for any reason */ - public static int enableBuffer() { + public static int enableBuffer() throws Exception { assert created : "The keyboard has not been created."; int buf_len = nEnableBuffer(); if (readBuffer != null) @@ -392,7 +388,7 @@ * @return the size of the buffer allocated, in events (1 event is 2 bytes), * or 0 if no buffer can be allocated */ - private static native int nEnableBuffer(); + private static native int nEnableBuffer() throws Exception; /** * Checks to see if a key is down. 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.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Mouse.java 16 Sep 2003 15:39:46 -0000 1.25 +++ Mouse.java 30 Sep 2003 10:52:05 -0000 1.26 @@ -146,7 +146,7 @@ } /** Native method to set the native cursor */ - private static native void nSetNativeCursor(int handle); + private static native void nSetNativeCursor(int handle) throws Exception; /** * Gets the minimum size of a native cursor. Can only be called if @@ -210,9 +210,7 @@ if (created) { return; } - if (!nCreate()) { - throw new Exception("The mouse could not be created."); - } + nCreate(); created = true; currentCursor = null; @@ -225,7 +223,7 @@ * * @return true if the mouse was created */ - private static native boolean nCreate(); + private static native void nCreate(); /** * @return true if the mouse has been created |
|
From: Elias N. <eli...@us...> - 2003-09-30 10:52:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv26555/src/java/org/lwjgl/test/input Modified Files: KeyboardTest.java Log Message: boolean results -> Exceptions Index: KeyboardTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- KeyboardTest.java 23 Aug 2003 09:45:22 -0000 1.13 +++ KeyboardTest.java 30 Sep 2003 10:52:05 -0000 1.14 @@ -107,6 +107,8 @@ private void createKeyboard() { try { Keyboard.create(); + Keyboard.enableBuffer(); + Keyboard.enableTranslation(); } catch (Exception e) { e.printStackTrace(); System.exit(-1); @@ -114,8 +116,6 @@ } private void wiggleKeyboard() { - Keyboard.enableBuffer(); - Keyboard.enableTranslation(); while (!Window.isCloseRequested()) { Window.update(); |
|
From: Elias N. <eli...@us...> - 2003-09-29 12:38:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv22446/src/native/macosx Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Various Mac stuff Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Window.cpp 26 Sep 2003 18:36:54 -0000 1.6 +++ org_lwjgl_opengl_Window.cpp 29 Sep 2003 09:26:20 -0000 1.7 @@ -42,6 +42,7 @@ #include <Carbon/Carbon.h> #include <JavaVM/jni.h> #include "org_lwjgl_opengl_Window.h" +#include "extgl.h" static WindowRef win_ref; static bool close_requested; @@ -56,24 +57,9 @@ env->DeleteLocalRef(cls); } -/*static void dumpRootMenu() { - MenuRef root = AcquireRootMenu(); - if (root == NULL) - printf("NULL menu\n"); - UInt16 count = CountMenuItems(root); - printf("item count: %d\n", count); - for (int i = 0; i < count; i++) { - Str255 menu_text; - GetMenuItemText(root, i, menu_text); - printf("Item text: %s\n", menu_text); - } - ReleaseMenu(root); -} -*/ static void setWindowTitle(JNIEnv *env, jstring title_obj) { const char* title = env->GetStringUTFChars(title_obj, NULL); - int str_len = env->GetStringUTFLength(title_obj); - CFStringRef cf_title = CFStringCreateWithBytes(NULL, (const UInt8*)title, str_len, kCFStringEncodingUTF8, false); + CFStringRef cf_title = CFStringCreateWithCStringNoCopy(NULL, title, kCFStringEncodingUTF8, kCFAllocatorNull); if (cf_title == NULL) { #ifdef _DEBUG printf("Could not set window title\n"); @@ -81,18 +67,8 @@ return; } SetWindowTitleWithCFString(win_ref, cf_title); -/* MenuRef root; - OSStatus err = CreateNewMenu(1, 0, &root); - assert(err == noErr); - MenuItemIndex item_index; - err = AppendMenuItemTextWithCFString(root, cf_title, 0, FOUR_CHAR_CODE('1234'), &item_index); - assert(err == noErr); - err = SetRootMenu(root); - assert(err == noErr); - ReleaseMenu(root);*/ CFRelease(cf_title); env->ReleaseStringUTFChars(title_obj, title); -// dumpRootMenu(); } static pascal OSStatus doQuit(EventHandlerCallRef next_handler, EventRef event, void *user_data) { @@ -102,37 +78,47 @@ } static void registerEventHandlers(JNIEnv *env) { - /*EventTargetRef event_target = GetWindowEventTarget(win_ref); - status = InstallStandardEventHandler(event_target); - if (noErr != status) { - DisposeWindow(win_ref); - throwException(env, "Could not install default window event handler"); - return; - }*/ - EventTypeSpec event_types[1]; + EventTypeSpec event_type; OSStatus err; EventHandlerUPP handler_upp = NewEventHandlerUPP(doQuit); - event_types[0].eventClass = kEventClassWindow; - event_types[0].eventKind = kEventWindowClose; - err = InstallWindowEventHandler(win_ref, handler_upp, 1, event_types, NULL, NULL); + event_type.eventClass = kEventClassWindow; + event_type.eventKind = kEventWindowClose; + err = InstallWindowEventHandler(win_ref, handler_upp, 1, &event_type, NULL, NULL); if (noErr != err) { DisposeEventHandlerUPP(handler_upp); throwException(env, "Could not register window event handler"); return; } - event_types[0].eventClass = kEventClassApplication; - event_types[0].eventKind = kEventAppQuit; - /*event_types[1].eventClass = kEventClassAppleEvent; - event_types[1].eventKind = kEventAppleEvent;*/ - err = InstallApplicationEventHandler(handler_upp, 1, event_types, NULL, NULL); - if (noErr != err) { - DisposeEventHandlerUPP(handler_upp); - throwException(env, "Could not register application event handler"); - return; - } DisposeEventHandlerUPP(handler_upp); } +static void destroy(void) { + DisposeWindow(win_ref); + extgl_Close(); +} + +static bool createContext(JNIEnv *env, jint bpp, jint alpha, jint depth, jint stencil) { + SetPort(GetWindowPort(win_ref)); + GLint attrib[] = {AGL_RGBA, + AGL_DOUBLEBUFFER, + AGL_ACCELERATED, + AGL_SINGLE_RENDERER, + AGL_FULLSCREEN, + AGL_MINIMUM_POLICY, + AGL_PIXEL_SIZE, bpp, + AGL_DEPTH_SIZE, depth, + AGL_ALPHA_SIZE, alpha, + AGL_STENCIL_SIZE, stencil, + AGL_NONE}; + AGLPixelFormat format = aglChoosePixelFormat(NULL, 0, attrib); + if (format == NULL) { + throwException(env, "Could not find matching pixel format"); + return false; + } +printf("Found matching pixel format\n "); + aglDestroyPixelFormat(format); + return true; +} JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Window_nIsCloseRequested(JNIEnv *, jclass) { const bool saved = close_requested; @@ -140,50 +126,22 @@ return saved; } -/*OSErr aehandler(const AppleEvent * theAppleEvent, AppleEvent * reply, SInt32 handlerRefcon) { - printf("handler called\n"); - return noErr; -} -*/ - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { Rect rect; OSStatus status; const WindowAttributes window_attr = kWindowCloseBoxAttribute| kWindowCollapseBoxAttribute| kWindowStandardHandlerAttribute; -// CPSEnableForegroundOperation(); - /*//AEObjectInit(); - AEEventHandlerUPP handler = NewAEEventHandlerUPP(aehandler); - if (noErr != AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, handler, 0, FALSE)) - printf("error\n"); - if (noErr != AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, handler, 0, FALSE)) - printf("error\n"); - if (noErr != AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, handler, 0, FALSE)) - printf("error\n"); - if (noErr != AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, handler, 0, FALSE)) - printf("error\n"); - DisposeAEEventHandlerUPP(handler);*/ - /* - * Hacks to activate the application window - */ - /*CFBundleRef bundle = CFBundleGetMainBundle(); - if (bundle != NULL) { - printf("bundle != NULL\n"); - CFRelease(bundle); - }*/ - /*ProcessSerialNumber PSN; - GetCurrentProcess(&PSN); - SetFrontProcess(&PSN);*/ - EventLoopRef queue = GetCurrentEventLoop(); - EventLoopRef main = GetMainEventLoop(); - QuitEventLoop(queue); - QuitEventLoop(main); - /*if (queue == main) - printf("equals\n");*/ SetRect(&rect, x, y, x + width, y + height); close_requested = false; - + if (!extgl_Open()) { + throwException(env, "Could not load gl library"); + return; + } + if (!extgl_InitAGL(env, ext_set)) { + throwException(env, "Could not load agl function pointers"); + return; + } status = CreateNewWindow(kDocumentWindowClass, window_attr, &rect, &win_ref); if (noErr != status) { throwException(env, "Could not create window"); @@ -193,43 +151,27 @@ setWindowTitle(env, title); const RGBColor background_color = { 0, 0, 0 }; SetWindowContentColor(win_ref, &background_color); - status = TransitionWindow(win_ref, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL); - if (noErr != status) { + if (!createContext(env, bpp, alpha, depth, stencil)) { DisposeWindow(win_ref); - throwException(env, "Could not show window"); + extgl_Close(); return; } + if (!extgl_Initialize(env, ext_set)) { + destroy(); + throwException(env, "Could not load gl function pointers"); + return; + } + TransitionWindow(win_ref, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL); SelectWindow(win_ref); - InitCursor(); -//QuitApplicationEventLoop(); -//RunApplicationEventLoop(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_update (JNIEnv *env, jclass clazz) { - /*EventRef event; - OSStatus err; - int num_events = GetNumEventsInQueue(GetCurrentEventQueue()); - for (int i = 0; i < num_events; i++) { - UInt32 class_type = GetEventClass(event); - UInt32 kind = GetEventKind(event); - UInt32 test = FOUR_CHAR_CODE('eppc'); - EventTime event_time = GetEventTime(event); - //UInt32 test = FOUR_CHAR_CODE('appl'); - printf("recieved event: %x %x %x at %f\n", class_type, kind, test, event_time); - err = ReceiveNextEvent(0, NULL, 0, true, &event); - /* if (kind == kEventClassAppleEvent) - AEProcessAppleEvent(event);*/ - /* ReleaseEvent(event); - } - //RunCurrentEventLoop(0); -/* if (eventLoopTimedOutErr != RunCurrentEventLoop(0)) - printf("Could not run current event loop\n");*/ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nDestroy (JNIEnv *env, jclass clazz) { - DisposeWindow(win_ref); + destroy(); } |
|
From: Elias N. <eli...@us...> - 2003-09-29 12:08:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv22446/src/java/org/lwjgl/opengl Modified Files: Window.java Log Message: Various Mac stuff Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Window.java 26 Sep 2003 13:59:48 -0000 1.11 +++ Window.java 29 Sep 2003 09:26:20 -0000 1.12 @@ -30,8 +30,43 @@ static { System.loadLibrary(Sys.getLibraryName()); + /* + * elias: Mac OS X hacks. We need to fetch the toolkit to acquire a Dock icon, a system menu + * and to make windows behave normally. We also need to intercept the quit event from + * Swing. Luckily, Swing can be assumed to be present on Mac OS X. Because some of this + * is apple extensions to java, we need stub files to successfully compile on other platforms. + * + * Additionally, because of the way swing works, applications now need to do an + * explicit System.exit() to quit. Returning from the main thread is not enough any + * more. + * + * I've wasted a significant amount of time searching for an acceptable solution, without + * finding a way to avoid Swing. AFAIK, + * + * 1. There's no way to acquire the Dock icon, system menu and normal window behaviour. + * For that, you either need a proper bundled, native application or initialize Swing. + * 2. Even if there were a way around it, Swing is automatically started anyway if you + * use Java Web Start. + * 3. Swing gains total control over the main event loop, so the native library need to + * work around by maintaining an internal event queue. That's really boring stuff, indeed. + * + * I have posted a bug report to apple regarding the behaviour. + * + */ + if (Display.getPlatform() == Display.PLATFORM_AGL) { + java.awt.Toolkit.getDefaultToolkit(); + new com.apple.eawt.Application().addApplicationListener(new com.apple.eawt.ApplicationAdapter() { + public void handleQuit(com.apple.eawt.ApplicationEvent e) { + e.setHandled(false); + apple_quit = true; + } + }); + } } + /** Special quit boolean set from the apple version */ + private static boolean apple_quit; + /** Whether the window is currently created, ie. has a native peer */ private static boolean created; @@ -150,7 +185,9 @@ */ public static boolean isCloseRequested() { assert isCreated() : "Cannot determine state of uncreated window"; - return nIsCloseRequested(); + boolean result = nIsCloseRequested() || apple_quit; + apple_quit = false; + return result; } private static native boolean nIsCloseRequested(); @@ -305,6 +342,7 @@ throws Exception; private static void createWindow() throws Exception { + apple_quit = false; HashSet extensions = new HashSet(); nCreate(title, x, y, width, height, fullscreen, color, alpha, depth, stencil, extensions); GLCaps.determineAvailableExtensions(extensions); |
|
From: Elias N. <eli...@us...> - 2003-09-29 11:58:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv17295/macosx Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_opengl_Window.cpp 29 Sep 2003 09:26:20 -0000 1.7 +++ org_lwjgl_opengl_Window.cpp 29 Sep 2003 11:58:35 -0000 1.8 @@ -45,6 +45,7 @@ #include "extgl.h" static WindowRef win_ref; +static AGLContext context; static bool close_requested; /* @@ -59,7 +60,7 @@ static void setWindowTitle(JNIEnv *env, jstring title_obj) { const char* title = env->GetStringUTFChars(title_obj, NULL); - CFStringRef cf_title = CFStringCreateWithCStringNoCopy(NULL, title, kCFStringEncodingUTF8, kCFAllocatorNull); + CFStringRef cf_title = CFStringCreateWithCString(NULL, title, kCFStringEncodingUTF8); if (cf_title == NULL) { #ifdef _DEBUG printf("Could not set window title\n"); @@ -93,17 +94,20 @@ } static void destroy(void) { + aglSetCurrentContext(NULL); + aglDestroyContext(context); DisposeWindow(win_ref); extgl_Close(); } static bool createContext(JNIEnv *env, jint bpp, jint alpha, jint depth, jint stencil) { - SetPort(GetWindowPort(win_ref)); + AGLDrawable drawable = GetWindowPort(win_ref); + SetPort(drawable); GLint attrib[] = {AGL_RGBA, AGL_DOUBLEBUFFER, AGL_ACCELERATED, - AGL_SINGLE_RENDERER, - AGL_FULLSCREEN, + //AGL_FULLSCREEN, + AGL_NO_RECOVERY, AGL_MINIMUM_POLICY, AGL_PIXEL_SIZE, bpp, AGL_DEPTH_SIZE, depth, @@ -115,8 +119,23 @@ throwException(env, "Could not find matching pixel format"); return false; } -printf("Found matching pixel format\n "); + context = aglCreateContext (format, NULL); aglDestroyPixelFormat(format); + if (context == NULL) { + throwException(env, "Could not create context"); + return false; + } + //if (aglSetFullScreen(context, 800, 600, 85, 0) == GL_FALSE) { + if (aglSetDrawable(context, drawable) == GL_FALSE) { + aglDestroyContext(context); + throwException(env, "Could not attach context"); + return false; + } + if (aglSetCurrentContext(context) == GL_FALSE) { + aglDestroyContext(context); + throwException(env, "Could not set current context"); + return false; + } return true; } @@ -139,7 +158,7 @@ return; } if (!extgl_InitAGL(env, ext_set)) { - throwException(env, "Could not load agl function pointers"); + throwException(env, "Could not load agl symbols"); return; } status = CreateNewWindow(kDocumentWindowClass, window_attr, &rect, &win_ref); @@ -168,6 +187,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_update (JNIEnv *env, jclass clazz) { + aglSwapBuffers(context); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nDestroy |
|
From: Elias N. <eli...@us...> - 2003-09-29 11:58:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv17295/common Modified Files: extgl.cpp Log Message: Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- extgl.cpp 29 Sep 2003 09:26:20 -0000 1.4 +++ extgl.cpp 29 Sep 2003 11:58:35 -0000 1.5 @@ -1286,7 +1286,8 @@ #endif #ifdef _AGL -CFBundleRef gBundleRefOpenGL = NULL; +CFBundleRef opengl_bundle_ref = NULL; +CFBundleRef agl_bundle_ref = NULL; #endif #define EXTGL_SANITY_CHECK(e,h,x) if (extgl_error) { \ @@ -1319,13 +1320,14 @@ #ifdef _AGL // ------------------------- -OSStatus aglInitEntryPoints (void) +static CFBundleRef loadBundle(const Str255 frameworkName) { OSStatus err = noErr; - const Str255 frameworkName = "\pOpenGL.framework"; FSRefParam fileRefParam; FSRef fileRef; CFURLRef bundleURLOpenGL; + CFBundleRef bundle_ref; + memset(&fileRefParam, 0, sizeof(fileRefParam)); memset(&fileRef, 0, sizeof(fileRef)); fileRefParam.ioNamePtr = frameworkName; @@ -1336,8 +1338,10 @@ err = FindFolder (kSystemDomain, kFrameworksFolderType, false, &fileRefParam.ioVRefNum, &fileRefParam.ioDirID); if (noErr != err) { - DebugStr ("\pCould not find frameworks folder"); - return err; +#ifdef _DEBUG + printf("Could not find frameworks folder\n"); +#endif + return NULL; } // make FSRef for folder @@ -1350,7 +1354,7 @@ #ifdef _DEBUG printf("Could make FSref to frameworks folder\n"); #endif - return err; + return NULL; } // create URL to folder @@ -1359,58 +1363,40 @@ if (!bundleURLOpenGL) { #ifdef _DEBUG - printf("Could create OpenGL Framework bundle URL\n"); + printf("Could create framework URL\n"); #endif - return paramErr; + return NULL; } - // create ref to GL's bundle - // - gBundleRefOpenGL = CFBundleCreate (kCFAllocatorDefault,bundleURLOpenGL); - if (!gBundleRefOpenGL) + bundle_ref = CFBundleCreate(kCFAllocatorDefault,bundleURLOpenGL); + CFRelease (bundleURLOpenGL); + if (bundle_ref == NULL) { #ifdef _DEBUG - printf("Could not create OpenGL Framework bundle\n"); + printf("Could not load framework\n"); #endif - return paramErr; + return NULL; } - // release created bundle - // - CFRelease (bundleURLOpenGL); - // if the code was successfully loaded, look for our function. - if (!CFBundleLoadExecutable (gBundleRefOpenGL)) + if (!CFBundleLoadExecutable(bundle_ref)) { #ifdef _DEBUG printf("Could not load MachO executable\n"); #endif - return paramErr; + CFRelease(bundle_ref); + return NULL; } - return err; + return bundle_ref; } - -static void aglDellocEntryPoints (void) +static void aglUnloadFramework(CFBundleRef f) { - if (gBundleRefOpenGL != NULL) - { - // unload the bundle's code. - CFBundleUnloadExecutable (gBundleRefOpenGL); - CFRelease (gBundleRefOpenGL); - gBundleRefOpenGL = NULL; - } + CFBundleUnloadExecutable(f); + CFRelease(f); } - -static void * aglGetProcAddress (char * pszProc) -{ - CFStringRef str = CFStringCreateWithCStringNoCopy(NULL, pszProc, kCFStringEncodingUTF8, kCFAllocatorNull); - void *func_pointer = CFBundleGetFunctionPointerForName(gBundleRefOpenGL, str); - CFRelease(str); - return func_pointer; -} #endif /* getProcAddress */ @@ -1456,14 +1442,19 @@ #endif #ifdef _AGL - void *t = aglGetProcAddress(name); - if (t == NULL) { + CFStringRef str = CFStringCreateWithCStringNoCopy(NULL, name, kCFStringEncodingUTF8, kCFAllocatorNull); + void *func_pointer = CFBundleGetFunctionPointerForName(opengl_bundle_ref, str); + if (func_pointer == NULL) { + func_pointer = CFBundleGetFunctionPointerForName(agl_bundle_ref, str); + if (func_pointer == NULL) { #ifdef _DEBUG - printf("Could not locate symbol %s\n", name); + printf("Could not locate symbol %s\n", name); #endif - extgl_error = true; + extgl_error = true; + } } - return t; + CFRelease(str); + return func_pointer; #endif } @@ -3298,6 +3289,20 @@ return true; } +#ifdef _AGL +bool extgl_Open(void) { + opengl_bundle_ref = loadBundle("\pOpenGL.framework"); + if (opengl_bundle_ref == NULL) + return false; + agl_bundle_ref = loadBundle("\pAGL.framework"); + if (agl_bundle_ref == NULL) { + aglUnloadFramework(opengl_bundle_ref); + return false; + } + return true; +} +#endif + #ifdef _X11 bool extgl_Open() { @@ -3313,6 +3318,7 @@ #ifdef _DEBUG printf("Error loading libGLU.so.1: %s\n", dlerror()); #endif + dlclose(lib_gl_handle); return false; } return true; @@ -3329,29 +3335,13 @@ if (lib_gl_handle == NULL) return false; lib_glu_handle = LoadLibrary("glu32.dll"); - if (lib_glu_handle == NULL) - return false; - return true; -} -#endif /* WIN32 */ - -#ifdef _AGL -bool extgl_Open(void) -{ - OSStatus err = aglInitEntryPoints(); - if ( noErr != err ) - { - // if we encountered an error while initializing OpenGL - // we're hosed - return - // + if (lib_glu_handle == NULL) { + FreeLibrary(lib_gl_handle); return false; } - - // open gl framework initialized just fine - // return true; } -#endif /* _AGL */ +#endif /* WIN32 */ void extgl_Close(void) { @@ -3364,7 +3354,8 @@ FreeLibrary(lib_glu_handle); #endif #ifdef _AGL - aglDellocEntryPoints(); + aglUnloadFramework(opengl_bundle_ref); + aglUnloadFramework(agl_bundle_ref); #endif } |
|
From: Elias N. <eli...@us...> - 2003-09-29 11:45:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22446/src/native/common Modified Files: extgl.cpp extgl.h Log Message: Various Mac stuff Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- extgl.cpp 28 Sep 2003 13:09:17 -0000 1.3 +++ extgl.cpp 29 Sep 2003 09:26:20 -0000 1.4 @@ -88,6 +88,42 @@ glXQueryExtensionsStringPROC glXQueryExtensionsString = NULL; #endif +#ifdef _AGL +aglChoosePixelFormatPROC aglChoosePixelFormat = NULL; +aglDestroyPixelFormatPROC aglDestroyPixelFormat = NULL; +aglNextPixelFormatPROC aglNextPixelFormat = NULL; +aglDescribePixelFormatPROC aglDescribePixelFormat = NULL; +aglDevicesOfPixelFormatPROC aglDevicesOfPixelFormat = NULL; +aglQueryRendererInfoPROC aglQueryRendererInfo = NULL; +aglDestroyRendererInfoPROC aglDestroyRendererInfo = NULL; +aglNextRendererInfoPROC aglNextRendererInfo = NULL; +aglDescribeRendererPROC aglDescribeRenderer = NULL; +aglCreateContextPROC aglCreateContext = NULL; +aglDestroyContextPROC aglDestroyContext = NULL; +aglCopyContextPROC aglCopyContext = NULL; +aglUpdateContextPROC aglUpdateContext = NULL; +aglSetCurrentContextPROC aglSetCurrentContext = NULL; +aglGetCurrentContextPROC aglGetCurrentContext = NULL; +aglSetDrawablePROC aglSetDrawable = NULL; +aglSetOffScreenPROC aglSetOffScreen = NULL; +aglSetFullScreenPROC aglSetFullScreen = NULL; +aglGetDrawablePROC aglGetDrawable = NULL; +aglSetVirtualScreenPROC aglSetVirtualScreen = NULL; +aglGetVirtualScreenPROC aglGetVirtualScreen = NULL; +aglGetVersionPROC aglGetVersion = NULL; +aglSwapBuffersPROC aglSwapBuffers = NULL; +aglEnablePROC aglEnable = NULL; +aglDisablePROC aglDisable = NULL; +aglIsEnabledPROC aglIsEnabled = NULL; +aglSetIntegerPROC aglSetInteger = NULL; +aglGetIntegerPROC aglGetInteger = NULL; +aglUseFontPROC aglUseFont = NULL; +aglGetErrorPROC aglGetError = NULL; +aglErrorStringPROC aglErrorString = NULL; +aglResetLibraryPROC aglResetLibrary = NULL; +aglSurfaceTexturePROC aglSurfaceTexture = NULL; +#endif + gluBeginCurvePROC gluBeginCurve = NULL; gluBeginPolygonPROC gluBeginPolygon = NULL; gluBeginSurfacePROC gluBeginSurface = NULL; @@ -1311,7 +1347,9 @@ if (noErr != err) { - DebugStr ("\pCould make FSref to frameworks folder"); +#ifdef _DEBUG + printf("Could make FSref to frameworks folder\n"); +#endif return err; } @@ -1320,7 +1358,9 @@ bundleURLOpenGL = CFURLCreateFromFSRef (kCFAllocatorDefault, &fileRef); if (!bundleURLOpenGL) { - DebugStr ("\pCould create OpenGL Framework bundle URL"); +#ifdef _DEBUG + printf("Could create OpenGL Framework bundle URL\n"); +#endif return paramErr; } @@ -1329,7 +1369,9 @@ gBundleRefOpenGL = CFBundleCreate (kCFAllocatorDefault,bundleURLOpenGL); if (!gBundleRefOpenGL) { - DebugStr ("\pCould not create OpenGL Framework bundle"); +#ifdef _DEBUG + printf("Could not create OpenGL Framework bundle\n"); +#endif return paramErr; } @@ -1340,7 +1382,9 @@ // if the code was successfully loaded, look for our function. if (!CFBundleLoadExecutable (gBundleRefOpenGL)) { - DebugStr ("\pCould not load MachO executable"); +#ifdef _DEBUG + printf("Could not load MachO executable\n"); +#endif return paramErr; } @@ -1362,7 +1406,10 @@ static void * aglGetProcAddress (char * pszProc) { - return CFBundleGetFunctionPointerForName (gBundleRefOpenGL,CFStringCreateWithCStringNoCopy (NULL, pszProc, CFStringGetSystemEncoding (), NULL)); + CFStringRef str = CFStringCreateWithCStringNoCopy(NULL, pszProc, kCFStringEncodingUTF8, kCFAllocatorNull); + void *func_pointer = CFBundleGetFunctionPointerForName(gBundleRefOpenGL, str); + CFRelease(str); + return func_pointer; } #endif @@ -1579,11 +1626,42 @@ /*-----------------------------------------------------*/ #ifdef _AGL -static int extgl_InitializeAGL(JNIEnv *env, jobject ext_set) +bool extgl_InitAGL(JNIEnv *env, jobject ext_set) { - // add in AGL extensions here - - return 0; + aglChoosePixelFormat = (aglChoosePixelFormatPROC)extgl_GetProcAddress("aglChoosePixelFormat"); + aglDestroyPixelFormat = (aglDestroyPixelFormatPROC)extgl_GetProcAddress("aglDestroyPixelFormat"); + aglNextPixelFormat = (aglNextPixelFormatPROC)extgl_GetProcAddress("aglNextPixelFormat"); + aglDescribePixelFormat = (aglDescribePixelFormatPROC)extgl_GetProcAddress("aglDescribePixelFormat"); + aglDevicesOfPixelFormat = (aglDevicesOfPixelFormatPROC)extgl_GetProcAddress("aglDevicesOfPixelFormat"); + aglQueryRendererInfo = (aglQueryRendererInfoPROC)extgl_GetProcAddress("aglQueryRendererInfo"); + aglDestroyRendererInfo = (aglDestroyRendererInfoPROC)extgl_GetProcAddress("aglDestroyRendererInfo"); + aglNextRendererInfo = (aglNextRendererInfoPROC)extgl_GetProcAddress("aglNextRendererInfo"); + aglDescribeRenderer = (aglDescribeRendererPROC)extgl_GetProcAddress("aglDescribeRenderer"); + aglCreateContext = (aglCreateContextPROC)extgl_GetProcAddress("aglCreateContext"); + aglDestroyContext = (aglDestroyContextPROC)extgl_GetProcAddress("aglDestroyContext"); + aglCopyContext = (aglCopyContextPROC)extgl_GetProcAddress("aglCopyContext"); + aglUpdateContext = (aglUpdateContextPROC)extgl_GetProcAddress("aglUpdateContext"); + aglSetCurrentContext = (aglSetCurrentContextPROC)extgl_GetProcAddress("aglSetCurrentContext"); + aglGetCurrentContext = (aglGetCurrentContextPROC)extgl_GetProcAddress("aglGetCurrentContext"); + aglSetDrawable = (aglSetDrawablePROC)extgl_GetProcAddress("aglSetDrawable"); + aglSetOffScreen = (aglSetOffScreenPROC)extgl_GetProcAddress("aglSetOffScreen"); + aglSetFullScreen = (aglSetFullScreenPROC)extgl_GetProcAddress("aglSetFullScreen"); + aglGetDrawable = (aglGetDrawablePROC)extgl_GetProcAddress("aglGetDrawable"); + aglSetVirtualScreen = (aglSetVirtualScreenPROC)extgl_GetProcAddress("aglSetVirtualScreen"); + aglGetVirtualScreen = (aglGetVirtualScreenPROC)extgl_GetProcAddress("aglGetVirtualScreen"); + aglGetVersion = (aglGetVersionPROC)extgl_GetProcAddress("aglGetVersion"); + aglSwapBuffers = (aglSwapBuffersPROC)extgl_GetProcAddress("aglSwapBuffers"); + aglEnable = (aglEnablePROC)extgl_GetProcAddress("aglEnable"); + aglDisable = (aglDisablePROC)extgl_GetProcAddress("aglDisable"); + aglIsEnabled = (aglIsEnabledPROC)extgl_GetProcAddress("aglIsEnabled"); + aglSetInteger = (aglSetIntegerPROC)extgl_GetProcAddress("aglSetInteger"); + aglGetInteger = (aglGetIntegerPROC)extgl_GetProcAddress("aglGetInteger"); + aglUseFont = (aglUseFontPROC)extgl_GetProcAddress("aglUseFont"); + aglGetError = (aglGetErrorPROC)extgl_GetProcAddress("aglGetError"); + aglErrorString = (aglErrorStringPROC)extgl_GetProcAddress("aglErrorString"); + aglResetLibrary = (aglResetLibraryPROC)extgl_GetProcAddress("aglResetLibrary"); + aglSurfaceTexture = (aglSurfaceTexturePROC)extgl_GetProcAddress("aglSurfaceTexture"); + return !extgl_error; } #endif @@ -3046,7 +3124,6 @@ extgl_Extensions.OpenGL12 = false; extgl_Extensions.OpenGL13 = false; extgl_Extensions.OpenGL14 = false; - if (s != NULL) { // Fall trhough @@ -3154,7 +3231,6 @@ bool extgl_Initialize(JNIEnv *env, jobject ext_set) { extgl_error = false; - extgl_InitOpenGL1_1(); extgl_InitGLU12(); if (extgl_error) @@ -3218,11 +3294,6 @@ #ifdef _WIN32 /* load WGL extensions */ extgl_InitializeWGL(env, ext_set); -#endif - -#ifdef _AGL - /* load AGL extensions */ - extgl_InitializeAGL(env, ext_set); #endif return true; } Index: extgl.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- extgl.h 26 Sep 2003 13:59:49 -0000 1.15 +++ extgl.h 29 Sep 2003 09:26:20 -0000 1.16 @@ -343,73 +343,73 @@ void aglDellocEntryPoints (void); void * aglGetProcAddress (char * pszProc); */ -typedef AGLPixelFormat (APIENTRY * aglChoosePixelFormatEXTPROC)(const AGLDevice *gdevs, GLint ndev, const GLint *attribs); -typedef void (APIENTRY * aglDestroyPixelFormatEXTPROC)(AGLPixelFormat pix); -typedef AGLPixelFormat (APIENTRY * aglNextPixelFormatEXTPROC)(AGLPixelFormat pix); -typedef GLboolean (APIENTRY * aglDescribePixelFormatEXTPROC)(AGLPixelFormat pix, GLint attrib, GLint *value); -typedef AGLDevice * (APIENTRY * aglDevicesOfPixelFormatEXTPROC)(AGLPixelFormat pix, GLint *ndevs); -typedef AGLRendererInfo (APIENTRY * aglQueryRendererInfoEXTPROC)(const AGLDevice *gdevs, GLint ndev); -typedef void (APIENTRY * aglDestroyRendererInfoEXTPROC)(AGLRendererInfo rend); -typedef AGLRendererInfo (APIENTRY * aglNextRendererInfoEXTPROC)(AGLRendererInfo rend); -typedef GLboolean (APIENTRY * aglDescribeRendererEXTPROC)(AGLRendererInfo rend, GLint prop, GLint *value); -typedef AGLContext (APIENTRY * aglCreateContextEXTPROC)(AGLPixelFormat pix, AGLContext share); -typedef GLboolean (APIENTRY * aglDestroyContextEXTPROC)(AGLContext ctx); -typedef GLboolean (APIENTRY * aglCopyContextEXTPROC)(AGLContext src, AGLContext dst, GLuint mask); -typedef GLboolean (APIENTRY * aglUpdateContextEXTPROC)(AGLContext ctx); -typedef GLboolean (APIENTRY * aglSetCurrentContextEXTPROC)(AGLContext ctx); -typedef AGLContext (APIENTRY * aglGetCurrentContextEXTPROC)(void); -typedef GLboolean (APIENTRY * aglSetDrawableEXTPROC)(AGLContext ctx, AGLDrawable draw); -typedef GLboolean (APIENTRY * aglSetOffScreenEXTPROC)(AGLContext ctx, GLsizei width, GLsizei height, GLsizei rowbytes, GLvoid *baseaddr); -typedef GLboolean (APIENTRY * aglSetFullScreenEXTPROC)(AGLContext ctx, GLsizei width, GLsizei height, GLsizei freq, GLint device); -typedef AGLDrawable (APIENTRY * aglGetDrawableEXTPROC)(AGLContext ctx); -typedef GLboolean (APIENTRY * aglSetVirtualScreenEXTPROC)(AGLContext ctx, GLint screen); -typedef GLint (APIENTRY * aglGetVirtualScreenEXTPROC)(AGLContext ctx); -typedef void (APIENTRY * aglGetVersionEXTPROC)(GLint *major, GLint *minor); -typedef void (APIENTRY * aglSwapBuffersEXTPROC)(AGLContext ctx); -typedef GLboolean (APIENTRY * aglEnableEXTPROC)(AGLContext ctx, GLenum pname); -typedef GLboolean (APIENTRY * aglDisableEXTPROC)(AGLContext ctx, GLenum pname); -typedef GLboolean (APIENTRY * aglIsEnabledEXTPROC)(AGLContext ctx, GLenum pname); -typedef GLboolean (APIENTRY * aglSetIntegerEXTPROC)(AGLContext ctx, GLenum pname, const GLint *params); -typedef GLboolean (APIENTRY * aglGetIntegerEXTPROC)(AGLContext ctx, GLenum pname, GLint *params); -typedef GLboolean (APIENTRY * aglUseFontEXTPROC)(AGLContext ctx, GLint fontID, Style face, GLint size, GLint first, GLint count, GLint base); -typedef GLenum (APIENTRY * aglGetErrorEXTPROC)(void); -typedef const GLubyte * (APIENTRY * aglErrorStringEXTPROC)(GLenum code); -typedef void (APIENTRY * aglResetLibraryEXTPROC)(void); -typedef void (APIENTRY * aglSurfaceTextureEXTPROC) (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext); +typedef AGLPixelFormat (APIENTRY * aglChoosePixelFormatPROC)(const AGLDevice *gdevs, GLint ndev, const GLint *attribs); +typedef void (APIENTRY * aglDestroyPixelFormatPROC)(AGLPixelFormat pix); +typedef AGLPixelFormat (APIENTRY * aglNextPixelFormatPROC)(AGLPixelFormat pix); +typedef GLboolean (APIENTRY * aglDescribePixelFormatPROC)(AGLPixelFormat pix, GLint attrib, GLint *value); +typedef AGLDevice * (APIENTRY * aglDevicesOfPixelFormatPROC)(AGLPixelFormat pix, GLint *ndevs); +typedef AGLRendererInfo (APIENTRY * aglQueryRendererInfoPROC)(const AGLDevice *gdevs, GLint ndev); +typedef void (APIENTRY * aglDestroyRendererInfoPROC)(AGLRendererInfo rend); +typedef AGLRendererInfo (APIENTRY * aglNextRendererInfoPROC)(AGLRendererInfo rend); +typedef GLboolean (APIENTRY * aglDescribeRendererPROC)(AGLRendererInfo rend, GLint prop, GLint *value); +typedef AGLContext (APIENTRY * aglCreateContextPROC)(AGLPixelFormat pix, AGLContext share); +typedef GLboolean (APIENTRY * aglDestroyContextPROC)(AGLContext ctx); +typedef GLboolean (APIENTRY * aglCopyContextPROC)(AGLContext src, AGLContext dst, GLuint mask); +typedef GLboolean (APIENTRY * aglUpdateContextPROC)(AGLContext ctx); +typedef GLboolean (APIENTRY * aglSetCurrentContextPROC)(AGLContext ctx); +typedef AGLContext (APIENTRY * aglGetCurrentContextPROC)(void); +typedef GLboolean (APIENTRY * aglSetDrawablePROC)(AGLContext ctx, AGLDrawable draw); +typedef GLboolean (APIENTRY * aglSetOffScreenPROC)(AGLContext ctx, GLsizei width, GLsizei height, GLsizei rowbytes, GLvoid *baseaddr); +typedef GLboolean (APIENTRY * aglSetFullScreenPROC)(AGLContext ctx, GLsizei width, GLsizei height, GLsizei freq, GLint device); +typedef AGLDrawable (APIENTRY * aglGetDrawablePROC)(AGLContext ctx); +typedef GLboolean (APIENTRY * aglSetVirtualScreenPROC)(AGLContext ctx, GLint screen); +typedef GLint (APIENTRY * aglGetVirtualScreenPROC)(AGLContext ctx); +typedef void (APIENTRY * aglGetVersionPROC)(GLint *major, GLint *minor); +typedef void (APIENTRY * aglSwapBuffersPROC)(AGLContext ctx); +typedef GLboolean (APIENTRY * aglEnablePROC)(AGLContext ctx, GLenum pname); +typedef GLboolean (APIENTRY * aglDisablePROC)(AGLContext ctx, GLenum pname); +typedef GLboolean (APIENTRY * aglIsEnabledPROC)(AGLContext ctx, GLenum pname); +typedef GLboolean (APIENTRY * aglSetIntegerPROC)(AGLContext ctx, GLenum pname, const GLint *params); +typedef GLboolean (APIENTRY * aglGetIntegerPROC)(AGLContext ctx, GLenum pname, GLint *params); +typedef GLboolean (APIENTRY * aglUseFontPROC)(AGLContext ctx, GLint fontID, Style face, GLint size, GLint first, GLint count, GLint base); +typedef GLenum (APIENTRY * aglGetErrorPROC)(void); +typedef const GLubyte * (APIENTRY * aglErrorStringPROC)(GLenum code); +typedef void (APIENTRY * aglResetLibraryPROC)(void); +typedef void (APIENTRY * aglSurfaceTexturePROC) (AGLContext context, GLenum target, GLenum internalformat, AGLContext surfacecontext); -extern aglChoosePixelFormatEXTPROC aglChoosePixelFormat; -extern aglDestroyPixelFormatEXTPROC aglDestroyPixelFormat; -extern aglNextPixelFormatEXTPROC aglNextPixelFormat; -extern aglDescribePixelFormatEXTPROC aglDescribePixelFormat; -extern aglDevicesOfPixelFormatEXTPROC aglDevicesOfPixelFormat; -extern aglQueryRendererInfoEXTPROC aglQueryRendererInfo; -extern aglDestroyRendererInfoEXTPROC aglDestroyRendererInfo; -extern aglNextRendererInfoEXTPROC aglNextRendererInfo; -extern aglDescribeRendererEXTPROC aglDescribeRenderer; -extern aglCreateContextEXTPROC aglCreateContext; -extern aglDestroyContextEXTPROC aglDestroyContext; -extern aglCopyContextEXTPROC aglCopyContext; -extern aglUpdateContextEXTPROC aglUpdateContext; -extern aglSetCurrentContextEXTPROC aglSetCurrentContext; -extern aglGetCurrentContextEXTPROC aglGetCurrentContext; -extern aglSetDrawableEXTPROC aglSetDrawable; -extern aglSetOffScreenEXTPROC aglSetOffScreen; -extern aglSetFullScreenEXTPROC aglSetFullScreen; -extern aglGetDrawableEXTPROC aglGetDrawable; -extern aglSetVirtualScreenEXTPROC aglSetVirtualScreen; -extern aglGetVirtualScreenEXTPROC aglGetVirtualScreen; -extern aglGetVersionEXTPROC aglGetVersion; -extern aglSwapBuffersEXTPROC aglSwapBuffers; -extern aglEnableEXTPROC aglEnable; -extern aglDisableEXTPROC aglDisable; -extern aglIsEnabledEXTPROC aglIsEnabled; -extern aglSetIntegerEXTPROC aglSetInteger; -extern aglGetIntegerEXTPROC aglGetInteger; -extern aglUseFontEXTPROC aglUseFont; -extern aglGetErrorEXTPROC aglGetError; -extern aglErrorStringEXTPROC aglErrorString; -extern aglResetLibraryEXTPROC aglResetlibrary; -extern aglSurfaceTextureEXTPROC aglSurfaceTexture; +extern aglChoosePixelFormatPROC aglChoosePixelFormat; +extern aglDestroyPixelFormatPROC aglDestroyPixelFormat; +extern aglNextPixelFormatPROC aglNextPixelFormat; +extern aglDescribePixelFormatPROC aglDescribePixelFormat; +extern aglDevicesOfPixelFormatPROC aglDevicesOfPixelFormat; +extern aglQueryRendererInfoPROC aglQueryRendererInfo; +extern aglDestroyRendererInfoPROC aglDestroyRendererInfo; +extern aglNextRendererInfoPROC aglNextRendererInfo; +extern aglDescribeRendererPROC aglDescribeRenderer; +extern aglCreateContextPROC aglCreateContext; +extern aglDestroyContextPROC aglDestroyContext; +extern aglCopyContextPROC aglCopyContext; +extern aglUpdateContextPROC aglUpdateContext; +extern aglSetCurrentContextPROC aglSetCurrentContext; +extern aglGetCurrentContextPROC aglGetCurrentContext; +extern aglSetDrawablePROC aglSetDrawable; +extern aglSetOffScreenPROC aglSetOffScreen; +extern aglSetFullScreenPROC aglSetFullScreen; +extern aglGetDrawablePROC aglGetDrawable; +extern aglSetVirtualScreenPROC aglSetVirtualScreen; +extern aglGetVirtualScreenPROC aglGetVirtualScreen; +extern aglGetVersionPROC aglGetVersion; +extern aglSwapBuffersPROC aglSwapBuffers; +extern aglEnablePROC aglEnable; +extern aglDisablePROC aglDisable; +extern aglIsEnabledPROC aglIsEnabled; +extern aglSetIntegerPROC aglSetInteger; +extern aglGetIntegerPROC aglGetInteger; +extern aglUseFontPROC aglUseFont; +extern aglGetErrorPROC aglGetError; +extern aglErrorStringPROC aglErrorString; +extern aglResetLibraryPROC aglResetLibrary; +extern aglSurfaceTexturePROC aglSurfaceTexture; /************************************************************************/ @@ -5424,6 +5424,9 @@ bool extgl_Open(void); #ifdef _X11 bool extgl_InitGLX(JNIEnv *env, jobject ext_set, Display *disp, int screen); +#endif +#ifdef _AGL +bool extgl_InitAGL(JNIEnv *env, jobject ext_set); #endif void extgl_Close(void); |
|
From: Elias N. <eli...@us...> - 2003-09-28 13:09:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv2359/common Modified Files: extgl.cpp Log Message: Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- extgl.cpp 26 Sep 2003 18:36:54 -0000 1.2 +++ extgl.cpp 28 Sep 2003 13:09:17 -0000 1.3 @@ -1593,7 +1593,7 @@ #ifdef _X11 /** returns true if the extention is available */ -static int GLXQueryExtension(JNIEnv* env, jobject ext_set, Display *disp, int screen, const char *name) +static bool GLXQueryExtension(JNIEnv* env, jobject ext_set, Display *disp, int screen, const char *name) { const GLubyte *exts = (const GLubyte *)glXQueryExtensionsString(disp, screen); return QueryExtension(env, ext_set, exts, name); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-09-28 08:40:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv12469/src/native/win32 Modified Files: org_lwjgl_Display.cpp Log Message: New API for adapter queries Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- org_lwjgl_Display.cpp 16 Sep 2003 15:42:25 -0000 1.49 +++ org_lwjgl_Display.cpp 28 Sep 2003 06:55:00 -0000 1.50 @@ -51,7 +51,6 @@ WORD* currentGamma = new WORD[256 * 3]; // Current gamma settings DEVMODE devmode; // Now we'll remember this value for the future - /* * Class: org_lwjgl_Display * Method: nGetAvailableDisplayModes @@ -467,7 +466,149 @@ } ReleaseDC(NULL, screenDC); + +} + +char * getDriver() { + #define MY_BUFSIZE 256 + + HKEY hKey; + static TCHAR szAdapterKey[MY_BUFSIZE], szDriverValue[MY_BUFSIZE]; + DWORD dwBufLen = MY_BUFSIZE; + LONG lRet; + + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, + TEXT("HARDWARE\\DeviceMap\\Video"), + 0, + KEY_QUERY_VALUE, + &hKey) != ERROR_SUCCESS) return NULL; + + lRet = RegQueryValueEx(hKey, + TEXT("\\Device\\Video0"), + NULL, + NULL, + (LPBYTE)szAdapterKey, + &dwBufLen); + + RegCloseKey(hKey); + + if(lRet != ERROR_SUCCESS) return NULL; + +#ifdef _DEBUG + printf("Adapter key: %s\n", szAdapterKey); +#endif + + // szAdapterKey now contains something like \Registry\Machine\System\CurrentControlSet\Control\Video\{B70DBD2A-90C4-41CF-A58E-F3BA69F1A6BC}\0000 + // We'll check for the first chunk: + if (strncmp("\\Registry\\Machine", szAdapterKey, 17) == 0) { + // Yes, it's right, so let's look for that key now + + TCHAR szDriverKey[MY_BUFSIZE]; + strcpy(szDriverKey, &szAdapterKey[18]); +#ifdef _DEBUG + printf("Driver key: %s\n", szDriverKey); +#endif + + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, + TEXT(szDriverKey), + 0, + KEY_QUERY_VALUE, + &hKey) != ERROR_SUCCESS) return NULL; + + lRet = RegQueryValueEx(hKey, + TEXT("InstalledDisplayDrivers"), + NULL, + NULL, + (LPBYTE)szDriverValue, + &dwBufLen); + + RegCloseKey(hKey); + + } + + if(lRet != ERROR_SUCCESS) return NULL; + + return szDriverValue; } + +/* + * Class: org_lwjgl_Display + * Method: getAdapter + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getAdapter + (JNIEnv * env, jclass clazz) +{ + + jstring ret = NULL; + char * driver = getDriver(); + if (driver == NULL) { + return NULL; + } + ret = env->NewStringUTF( + driver + ); + return ret; +} + + + +/* + * Class: org_lwjgl_Display + * Method: getVersion + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getVersion + (JNIEnv * env, jclass clazz) +{ + jstring ret = NULL; + + TCHAR driverDLL[256] = "\0"; + + char * driver = getDriver(); + if (driver == NULL) { + return NULL; + } + strcat(driverDLL, driver); + strcat(driverDLL, ".dll"); +#ifdef _DEBUG + printf("Driver dll = %s\n", driverDLL); +#endif + DWORD var = 0; + DWORD dwInfoSize = GetFileVersionInfoSize(driverDLL, &var); + LPVOID lpInfoBuff = new unsigned char[dwInfoSize]; + BOOL bRetval = GetFileVersionInfo(driverDLL, NULL, dwInfoSize, lpInfoBuff); + if (bRetval == 0) { +#ifdef _DEBUG + printf("GetFileVersionInfo failed\n"); +#endif + } else { + VS_FIXEDFILEINFO * fxdFileInfo; + + UINT uiLen = 0; + bRetval = VerQueryValue(lpInfoBuff, TEXT("\\"), (void **) &fxdFileInfo, &uiLen); + if (bRetval == 0) { +#ifdef _DEBUG + printf("VerQueryValue failed\n"); +#endif + } else { + TCHAR version[256]; + TCHAR ms[10], ls[10]; + sprintf(ms, "%d.%d\0", fxdFileInfo->dwProductVersionMS >> 16, fxdFileInfo->dwProductVersionMS & 0xFFFF); + sprintf(ls, "%d.%d\0", fxdFileInfo->dwProductVersionLS >> 16, fxdFileInfo->dwProductVersionLS & 0xFFFF); + sprintf(version, "%s.%s\0", ms, ls); + ret = env->NewStringUTF( + version + ); + } + } + + delete lpInfoBuff; + + return ret; +} + + + + |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-09-28 08:39:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv12469/src/java/org/lwjgl Modified Files: Display.java Log Message: New API for adapter queries 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.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- Display.java 17 Aug 2003 16:38:55 -0000 1.32 +++ Display.java 28 Sep 2003 06:55:01 -0000 1.33 @@ -80,6 +80,9 @@ static { System.loadLibrary(Sys.getLibraryName()); init(); + if (Sys.DEBUG) { + System.out.println("Adapter: "+getAdapter()+" Version: "+getVersion()); + } } /** @@ -254,4 +257,19 @@ * Native method to set the gamma ramp. */ private static native boolean setGammaRamp(FloatBuffer gammaRamp); + + /** + * Get the driver adapter string. This is a unique string describing the actual card's hardware, eg. "Geforce2", "PS2", + * "Radeon9700". If the adapter cannot be determined, this function returns null. + * @return a String + */ + public static native String getAdapter(); + + /** + * Get the driver version. This is a vendor/adapter specific version string. If the version cannot be determined, + * this function returns null. + * @return a String + */ + public static native String getVersion(); + } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-09-28 08:39:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv12469/src/native/common Modified Files: org_lwjgl_Display.h Log Message: New API for adapter queries Index: org_lwjgl_Display.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_Display.h 24 Jun 2003 12:24:55 -0000 1.13 +++ org_lwjgl_Display.h 28 Sep 2003 06:55:01 -0000 1.14 @@ -75,6 +75,20 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp (JNIEnv *, jclass, jobject); +/* + * Class: org_lwjgl_Display + * Method: getAdapter + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getAdapter + (JNIEnv * , jclass); + +/* + * Class: org_lwjgl_Display + * Method: getVersion + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getVersion + (JNIEnv * , jclass); + #ifdef __cplusplus } #endif |
|
From: Elias N. <eli...@us...> - 2003-09-28 08:12:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv13540/linux Modified Files: org_lwjgl_Display.cpp Log Message: Dummy getAdapter()/getVersion() for linux 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.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- org_lwjgl_Display.cpp 8 Sep 2003 14:51:01 -0000 1.38 +++ org_lwjgl_Display.cpp 28 Sep 2003 07:02:23 -0000 1.39 @@ -334,3 +334,14 @@ return JNI_TRUE; } +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getAdapter + (JNIEnv * env, jclass clazz) +{ + return NULL; +} + +JNIEXPORT jstring JNICALL Java_org_lwjgl_Display_getVersion + (JNIEnv * env, jclass clazz) +{ + return NULL; +} |
|
From: Elias N. <eli...@us...> - 2003-09-26 18:37:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv12310/common Modified Files: extgl.cpp Log Message: Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extgl.cpp 26 Sep 2003 13:59:49 -0000 1.1 +++ extgl.cpp 26 Sep 2003 18:36:54 -0000 1.2 @@ -1579,7 +1579,7 @@ /*-----------------------------------------------------*/ #ifdef _AGL -static int extgl_InitializeAGL() +static int extgl_InitializeAGL(JNIEnv *env, jobject ext_set) { // add in AGL extensions here |
|
From: Elias N. <eli...@us...> - 2003-09-26 18:37:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv12310/macosx Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_opengl_Window.cpp 26 Sep 2003 13:59:50 -0000 1.5 +++ org_lwjgl_opengl_Window.cpp 26 Sep 2003 18:36:54 -0000 1.6 @@ -95,13 +95,13 @@ // dumpRootMenu(); } -static pascal OSStatus doWindowClose(EventHandlerCallRef next_handler, EventRef event, void *user_data) { +static pascal OSStatus doQuit(EventHandlerCallRef next_handler, EventRef event, void *user_data) { printf("Close requested\n"); close_requested = true; return noErr; } -static void registerEventHandlers(void) { +static void registerEventHandlers(JNIEnv *env) { /*EventTargetRef event_target = GetWindowEventTarget(win_ref); status = InstallStandardEventHandler(event_target); if (noErr != status) { @@ -109,12 +109,28 @@ throwException(env, "Could not install default window event handler"); return; }*/ - EventTypeSpec eventType; - eventType.eventClass = kEventClassWindow; - eventType.eventKind = kEventWindowClose; - EventHandlerUPP handlerUPP = NewEventHandlerUPP(doWindowClose); - InstallWindowEventHandler(win_ref, handlerUPP, 1, &eventType, NULL, NULL); - DisposeEventHandlerUPP(handlerUPP); + EventTypeSpec event_types[1]; + OSStatus err; + EventHandlerUPP handler_upp = NewEventHandlerUPP(doQuit); + event_types[0].eventClass = kEventClassWindow; + event_types[0].eventKind = kEventWindowClose; + err = InstallWindowEventHandler(win_ref, handler_upp, 1, event_types, NULL, NULL); + if (noErr != err) { + DisposeEventHandlerUPP(handler_upp); + throwException(env, "Could not register window event handler"); + return; + } + event_types[0].eventClass = kEventClassApplication; + event_types[0].eventKind = kEventAppQuit; + /*event_types[1].eventClass = kEventClassAppleEvent; + event_types[1].eventKind = kEventAppleEvent;*/ + err = InstallApplicationEventHandler(handler_upp, 1, event_types, NULL, NULL); + if (noErr != err) { + DisposeEventHandlerUPP(handler_upp); + throwException(env, "Could not register application event handler"); + return; + } + DisposeEventHandlerUPP(handler_upp); } @@ -124,10 +140,11 @@ return saved; } -OSErr aehandler(const AppleEvent * theAppleEvent, AppleEvent * reply, SInt32 handlerRefcon) { +/*OSErr aehandler(const AppleEvent * theAppleEvent, AppleEvent * reply, SInt32 handlerRefcon) { printf("handler called\n"); return noErr; } +*/ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { Rect rect; @@ -157,11 +174,13 @@ }*/ /*ProcessSerialNumber PSN; GetCurrentProcess(&PSN); - SetFrontProcess(&PSN); - EventQueueRef queue = GetCurrentEventQueue(); - if (queue == NULL) - printf("null event queue\n");*/ - + SetFrontProcess(&PSN);*/ + EventLoopRef queue = GetCurrentEventLoop(); + EventLoopRef main = GetMainEventLoop(); + QuitEventLoop(queue); + QuitEventLoop(main); + /*if (queue == main) + printf("equals\n");*/ SetRect(&rect, x, y, x + width, y + height); close_requested = false; @@ -170,7 +189,7 @@ throwException(env, "Could not create window"); return; } - registerEventHandlers(); + registerEventHandlers(env); setWindowTitle(env, title); const RGBColor background_color = { 0, 0, 0 }; SetWindowContentColor(win_ref, &background_color); @@ -183,14 +202,13 @@ SelectWindow(win_ref); InitCursor(); //QuitApplicationEventLoop(); -DebugPrintAllWindowGroups(); //RunApplicationEventLoop(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_update (JNIEnv *env, jclass clazz) { - EventRef event; + /*EventRef event; OSStatus err; int num_events = GetNumEventsInQueue(GetCurrentEventQueue()); for (int i = 0; i < num_events; i++) { @@ -203,7 +221,7 @@ err = ReceiveNextEvent(0, NULL, 0, true, &event); /* if (kind == kEventClassAppleEvent) AEProcessAppleEvent(event);*/ - ReleaseEvent(event); + /* ReleaseEvent(event); } //RunCurrentEventLoop(0); /* if (eventLoopTimedOutErr != RunCurrentEventLoop(0)) |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-09-26 16:51:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv14594/src/native/win32 Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Changed from wglSwapBuffers back to SwapBuffers. Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_opengl_Window.cpp 26 Sep 2003 13:59:50 -0000 1.7 +++ org_lwjgl_opengl_Window.cpp 26 Sep 2003 16:26:10 -0000 1.8 @@ -529,7 +529,8 @@ (JNIEnv * env, jclass clazz) { dirty = false; - wglSwapLayerBuffers(hdc, WGL_SWAP_MAIN_PLANE); + SwapBuffers(hdc); +// wglSwapLayerBuffers(hdc, WGL_SWAP_MAIN_PLANE); } /* |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-09-26 16:45:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv13408/src/java/org/lwjgl/vector Modified Files: Vector3f.java Vector2f.java Vector.java Vector4f.java Added Files: ReadableVector4f.java ReadableVector.java ReadableVector3f.java ReadableVector2f.java Log Message: New "const" style interfaces for Vectors --- NEW FILE: ReadableVector4f.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/ReadableVector4f.java /* * Copyright (c) 2003 Shaven Puppy Ltd * 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 'Shaven Puppy' 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.vector; /** * @author foo */ public interface ReadableVector4f extends ReadableVector3f { /** * @return w */ public float getW(); } --- NEW FILE: ReadableVector.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/ReadableVector.java /* * Copyright (c) 2003 Shaven Puppy Ltd * 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 'Shaven Puppy' 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.vector; import java.nio.FloatBuffer; /** * @author foo */ public interface ReadableVector { /** * @return the length of the vector */ public float length(); /** * @return the length squared of the vector */ public float lengthSquared(); /** * Store this vector in a FloatBuffer * @param buf The buffer to store it in, at the current position * @return this */ public Vector store(FloatBuffer buf); } --- NEW FILE: ReadableVector3f.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/ReadableVector3f.java /* * Copyright (c) 2003 Shaven Puppy Ltd * 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 'Shaven Puppy' 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.vector; /** * @author foo */ public interface ReadableVector3f extends ReadableVector2f { /** * @return z */ public float getZ(); } --- NEW FILE: ReadableVector2f.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/ReadableVector2f.java /* * Copyright (c) 2003 Shaven Puppy Ltd * 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 'Shaven Puppy' 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.vector; /** * @author foo */ public interface ReadableVector2f extends ReadableVector { /** * @return x */ public float getX(); /** * @return y */ public float getY(); } Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Vector3f.java 17 Aug 2003 16:38:57 -0000 1.15 +++ Vector3f.java 26 Sep 2003 16:19:18 -0000 1.16 @@ -43,7 +43,7 @@ * @version $Revision$ */ -public class Vector3f extends Vector implements Serializable { +public class Vector3f extends Vector implements Serializable, ReadableVector3f { public float x, y, z; @@ -57,7 +57,7 @@ /** * Constructor */ - public Vector3f(Vector3f src) { + public Vector3f(ReadableVector3f src) { set(src); } @@ -84,10 +84,10 @@ * @param src The source vector * @return this */ - public Vector3f set(Vector3f src) { - x = src.x; - y = src.y; - z = src.z; + public Vector3f set(ReadableVector3f src) { + x = src.getX(); + y = src.getY(); + z = src.getZ(); return this; } @@ -290,5 +290,48 @@ return sb.toString(); } + /** + * @return x + */ + public final float getX() { + return x; + } + + /** + * @return y + */ + public final float getY() { + return y; + } + + /** + * Set X + * @param x + */ + public final void setX(float x) { + this.x = x; + } + + /** + * Set Y + * @param y + */ + public final void setY(float y) { + this.y = y; + } + /** + * Set Z + * @param z + */ + public void setZ(float z) { + this.z = z; + } + + /* (Overrides) + * @see org.lwjgl.vector.ReadableVector3f#getZ() + */ + public float getZ() { + return z; + } } Index: Vector2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Vector2f.java 30 Aug 2003 14:25:09 -0000 1.13 +++ Vector2f.java 26 Sep 2003 16:19:18 -0000 1.14 @@ -43,7 +43,7 @@ * @version $Revision$ */ -public class Vector2f extends Vector implements Serializable { +public class Vector2f extends Vector implements Serializable, ReadableVector2f { public float x, y; @@ -57,7 +57,7 @@ /** * Constructor */ - public Vector2f(Vector2f src) { + public Vector2f(ReadableVector2f src) { set(src); } @@ -83,9 +83,9 @@ * @param src The source vector * @return this */ - public Vector2f set(Vector2f src) { - x = src.x; - y = src.y; + public Vector2f set(ReadableVector2f src) { + x = src.getX(); + y = src.getY(); return this; } @@ -254,4 +254,35 @@ sb.append(']'); return sb.toString(); } + + /** + * @return x + */ + public final float getX() { + return x; + } + + /** + * @return y + */ + public final float getY() { + return y; + } + + /** + * Set X + * @param x + */ + public final void setX(float x) { + this.x = x; + } + + /** + * Set Y + * @param y + */ + public final void setY(float y) { + this.y = y; + } + } Index: Vector.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Vector.java 30 Aug 2003 14:25:09 -0000 1.10 +++ Vector.java 26 Sep 2003 16:19:18 -0000 1.11 @@ -42,7 +42,7 @@ * @author cix_foo <ci...@us...> * @version $Revision$ */ -public abstract class Vector implements Serializable { +public abstract class Vector implements Serializable, ReadableVector { /** * Constructor for Vector. Index: Vector4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Vector4f.java 17 Aug 2003 09:04:12 -0000 1.11 +++ Vector4f.java 26 Sep 2003 16:19:18 -0000 1.12 @@ -43,7 +43,7 @@ * @version $Revision$ */ -public class Vector4f extends Vector implements Serializable { +public class Vector4f extends Vector implements Serializable, ReadableVector4f { public float x, y, z, w; @@ -57,7 +57,7 @@ /** * Constructor */ - public Vector4f(Vector4f src) { + public Vector4f(ReadableVector4f src) { set(src); } @@ -85,11 +85,11 @@ * @param src The source vector * @return this */ - public Vector4f set(Vector4f src) { - x = src.x; - y = src.y; - z = src.z; - w = src.w; + public Vector4f set(ReadableVector4f src) { + x = src.getX(); + y = src.getY(); + z = src.getZ(); + w = src.getW(); return this; } @@ -255,4 +255,66 @@ public String toString() { return "Vector4f: " + x + " " + y + " " + z + " " + w; } + + /** + * @return x + */ + public final float getX() { + return x; + } + + /** + * @return y + */ + public final float getY() { + return y; + } + + /** + * Set X + * @param x + */ + public final void setX(float x) { + this.x = x; + } + + /** + * Set Y + * @param y + */ + public final void setY(float y) { + this.y = y; + } + + /** + * Set Z + * @param z + */ + public void setZ(float z) { + this.z = z; + } + + /* (Overrides) + * @see org.lwjgl.vector.ReadableVector3f#getZ() + */ + public float getZ() { + return z; + } + + /** + * Set W + * @param w + */ + public void setW(float w) { + this.w = w; + } + + /* (Overrides) + * @see org.lwjgl.vector.ReadableVector3f#getZ() + */ + public float getW() { + return w; + } + + } |
|
From: Elias N. <eli...@us...> - 2003-09-26 13:59:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv17606/src/native/win32 Modified Files: org_lwjgl_opengl_Pbuffer.cpp org_lwjgl_opengl_Window.cpp Removed Files: org_lwjgl_opengl_GLCaps.cpp Log Message: Don't ignore lying drivers Index: org_lwjgl_opengl_Pbuffer.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_Pbuffer.cpp 20 May 2003 12:20:13 -0000 1.1 +++ org_lwjgl_opengl_Pbuffer.cpp 26 Sep 2003 13:59:50 -0000 1.2 @@ -17,7 +17,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps (JNIEnv *env, jclass clazz) { - return extgl_Extensions.wgl.ARB_pbuffer ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; + return extgl_Extensions.WGL_ARB_pbuffer ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } /* Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Window.cpp 11 Sep 2003 08:00:28 -0000 1.6 +++ org_lwjgl_opengl_Window.cpp 26 Sep 2003 13:59:50 -0000 1.7 @@ -166,7 +166,7 @@ } // 4. Initialise other things now - if (extgl_Open() != 0) { + if (!extgl_Open()) { throwException(env, "Failed to open extgl"); return -1; } @@ -538,7 +538,7 @@ * Signature: (Ljava/lang/String;IIIIZIIII)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil) + (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { closerequested = false; minimized = false; @@ -577,7 +577,7 @@ wglMakeCurrent(hdc, hglrc); // Initialise GL extensions - if (extgl_Initialize() != 0) { + if (!extgl_Initialize(env, ext_set)) { closeWindow(); throwException(env, "Failed to initialize GL extensions"); return; --- org_lwjgl_opengl_GLCaps.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_GLCaps.cpp |
|
From: Elias N. <eli...@us...> - 2003-09-26 13:59:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv17606/src/native/macosx Modified Files: Makefile.am org_lwjgl_opengl_Window.cpp Log Message: Don't ignore lying drivers Index: Makefile.am CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 8 Sep 2003 16:40:52 -0000 1.4 +++ Makefile.am 26 Sep 2003 13:59:50 -0000 1.5 @@ -11,6 +11,5 @@ # org_lwjgl_input_Mouse.cpp \ # org_lwjgl_input_Cursor.cpp \ org_lwjgl_opengl_Window.cpp -# org_lwjgl_opengl_GLCaps.cpp \ # org_lwjgl_opengl_Pbuffer.cpp Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_Window.cpp 23 Sep 2003 11:00:37 -0000 1.4 +++ org_lwjgl_opengl_Window.cpp 26 Sep 2003 13:59:50 -0000 1.5 @@ -129,7 +129,7 @@ return noErr; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { Rect rect; OSStatus status; const WindowAttributes window_attr = kWindowCloseBoxAttribute| |
|
From: Elias N. <eli...@us...> - 2003-09-26 13:59:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv17606/src/native/linux Modified Files: Makefile.am org_lwjgl_opengl_Pbuffer.cpp org_lwjgl_opengl_Window.cpp Removed Files: org_lwjgl_opengl_GLCaps.cpp Log Message: Don't ignore lying drivers Index: Makefile.am CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 7 Sep 2003 16:11:15 -0000 1.11 +++ Makefile.am 26 Sep 2003 13:59:50 -0000 1.12 @@ -11,7 +11,6 @@ org_lwjgl_input_Mouse.cpp \ org_lwjgl_input_Cursor.cpp \ org_lwjgl_opengl_Window.cpp \ - org_lwjgl_opengl_GLCaps.cpp \ org_lwjgl_opengl_Pbuffer.cpp \ extxcursor.cpp Index: org_lwjgl_opengl_Pbuffer.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_Pbuffer.cpp 20 May 2003 12:20:12 -0000 1.1 +++ org_lwjgl_opengl_Pbuffer.cpp 26 Sep 2003 13:59:50 -0000 1.2 @@ -29,7 +29,7 @@ (JNIEnv *env, jclass clazz) { // Only support thw GLX 1.3 Pbuffers and ignore the GLX_SGIX_pbuffer extension - return extgl_Extensions.glx.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; + return extgl_Extensions.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } /* Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Window.cpp 17 Aug 2003 18:40:58 -0000 1.6 +++ org_lwjgl_opengl_Window.cpp 26 Sep 2003 13:59:50 -0000 1.7 @@ -51,7 +51,7 @@ #include "Window.h" #include "org_lwjgl_opengl_Window.h" -#define USEGLX13 true +#define USEGLX13 extgl_Extensions.GLX13 static GLXContext context = NULL; // OpenGL rendering context static GLXWindow glx_window; @@ -286,14 +286,14 @@ } void makeCurrent(void) { - if (USEGLX13 && extgl_Extensions.glx.GLX13) + if (USEGLX13) glXMakeContextCurrent(getCurrentDisplay(), glx_window, glx_window, context); else glXMakeCurrent(getCurrentDisplay(), getCurrentWindow(), context); } static void releaseContext(void) { - if (USEGLX13 && extgl_Extensions.glx.GLX13) + if (USEGLX13) glXMakeContextCurrent(getCurrentDisplay(), None, None, NULL); else glXMakeCurrent(getCurrentDisplay(), None, NULL); @@ -367,7 +367,7 @@ static void destroy(void) { releaseContext(); - if (USEGLX13 && extgl_Extensions.glx.GLX13) + if (USEGLX13) glXDestroyWindow(getCurrentDisplay(), glx_window); glXDestroyContext(getCurrentDisplay(), context); context = NULL; @@ -446,7 +446,7 @@ * Signature: (IIII)Z */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil) + (JNIEnv * env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { int screen; Display *disp; @@ -454,7 +454,7 @@ if (fullscreen == JNI_TRUE) fscreen = true; - if (extgl_Open() != 0) { + if (!extgl_Open()) { throwException(env, "Could not load gl libs"); return; } @@ -464,14 +464,14 @@ return; } screen = XDefaultScreen(disp); - if (extgl_InitGLX(disp, screen) != 0) { + if (!extgl_InitGLX(env, ext_set, disp, screen)) { XCloseDisplay(disp); extgl_Close(); throwException(env, "Could not init GLX"); return; } bool create_success; - if (USEGLX13 && extgl_Extensions.glx.GLX13) { + if (USEGLX13) { create_success = initWindowGLX13(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, fscreen); } else { create_success = initWindowGLX(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, fscreen); @@ -481,7 +481,7 @@ extgl_Close(); return; } - if (extgl_Initialize() != 0) { + if (!extgl_Initialize(env, ext_set)) { destroy(); throwException(env, "Could not init gl function pointers"); return; @@ -511,7 +511,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_swapBuffers(JNIEnv * env, jclass clazz) { dirty = false; - if (USEGLX13 && extgl_Extensions.glx.GLX13) + if (USEGLX13) glXSwapBuffers(getCurrentDisplay(), glx_window); else glXSwapBuffers(getCurrentDisplay(), getCurrentWindow()); --- org_lwjgl_opengl_GLCaps.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GLCaps.cpp |
|
From: Elias N. <eli...@us...> - 2003-09-26 13:59:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv17606/src/native/common Modified Files: Makefile.am extgl.h org_lwjgl_opengl_Window.h Added Files: extgl.cpp Removed Files: extgl.c org_lwjgl_opengl_GLCaps.h Log Message: Don't ignore lying drivers --- NEW FILE: extgl.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp /* ---------------------------------------------------------------------------- Copyright (c) 2001-2002, Lev Povalahev 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. * The name of the author 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, [...3266 lines suppressed...] { #ifdef _X11 dlclose(lib_glu_handle); dlclose(lib_gl_handle); #endif #ifdef _WIN32 FreeLibrary(lib_gl_handle); FreeLibrary(lib_glu_handle); #endif #ifdef _AGL aglDellocEntryPoints(); #endif } /* turn on the warning for the borland compiler*/ #ifdef __BORLANDC__ #pragma warn .8064 #pragma warn .8065 #endif /* __BORLANDC__ */ Index: Makefile.am CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 3 Sep 2003 15:42:37 -0000 1.11 +++ Makefile.am 26 Sep 2003 13:59:49 -0000 1.12 @@ -5,7 +5,7 @@ COMMON = \ extal.cpp \ extal.h \ - extgl.c \ + extgl.cpp \ extgl.h \ org_lwjgl_Display.h \ org_lwjgl_Sys.h \ Index: extgl.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- extgl.h 7 Sep 2003 16:11:15 -0000 1.14 +++ extgl.h 26 Sep 2003 13:59:49 -0000 1.15 @@ -165,6 +165,8 @@ #ifndef __EXTGL_H__ #define __EXTGL_H__ +#include <jni.h> + /*-----------------------------------------*/ /*-----------------------------------------*/ @@ -598,9 +600,6 @@ /*************************************************************/ /* GLU functions */ [...1709 lines suppressed...] extern struct ExtensionTypes extgl_Extensions; - /* initializes everything, call this right after the rc is created. the function returns 0 if successful */ -int extgl_Initialize(); -int extgl_Open(void); +bool extgl_Initialize(JNIEnv *env, jobject gl_extensions); +bool extgl_Open(void); #ifdef _X11 -int extgl_InitGLX(Display *disp, int screen); +bool extgl_InitGLX(JNIEnv *env, jobject ext_set, Display *disp, int screen); #endif void extgl_Close(void); - -int glInitialize(); /* deprecated, please do not use */ #ifdef __cplusplus } Index: org_lwjgl_opengl_Window.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Window.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_opengl_Window.h 17 Aug 2003 18:40:58 -0000 1.5 +++ org_lwjgl_opengl_Window.h 26 Sep 2003 13:59:50 -0000 1.6 @@ -88,10 +88,10 @@ /* * Class: org_lwjgl_opengl_Window * Method: nCreate - * Signature: (Ljava/lang/String;IIIIZIIII)V + * Signature: (Ljava/lang/String;IIIIZIIIILjava/util/Vector;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate - (JNIEnv *, jclass, jstring, jint, jint, jint, jint, jboolean, jint, jint, jint, jint); + (JNIEnv *, jclass, jstring, jint, jint, jint, jint, jboolean, jint, jint, jint, jint, jobject); /* * Class: org_lwjgl_opengl_Window --- extgl.c DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c --- org_lwjgl_opengl_GLCaps.h DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GLCaps.h |