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
|
From: Elias N. <eli...@us...> - 2002-11-21 11:00:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv7663 Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Fixed a bug that made extensions unavailable Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_BaseGL.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_opengl_BaseGL.cpp 21 Nov 2002 11:00:40 -0000 1.2 @@ -47,6 +47,10 @@ extern Window win; extern Display * disp; +void makeCurrent(void) { + glXMakeCurrent(disp, win, context); +} + /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate @@ -70,6 +74,7 @@ return JNI_FALSE; } + makeCurrent(); if (extgl_Initialize() != 0) { #ifdef _DEBUG printf("Could not init gl function pointers\n"); @@ -112,6 +117,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nMakeCurrent (JNIEnv * env, jobject obj) { - glXMakeCurrent(disp, win, context); + makeCurrent(); } |
From: Elias N. <eli...@us...> - 2002-11-20 16:11:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv24879 Added Files: org_lwjgl_input_GamePad.cpp org_lwjgl_input_Joystick.cpp Log Message: Null joystick and gamepad files added --- NEW FILE: org_lwjgl_input_GamePad.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_GamePad.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_GamePad.cpp,v 1.1 2002/11/20 16:11:39 elias_naur Exp $ * * Win32 digital (Atari) joystick handling. These days it's a gamepad. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_input_GamePad.h" /* * Class: org_lwjgl_input_GamePad * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_initIDs (JNIEnv * env, jclass clazz) {} /* * Class: org_lwjgl_input_GamePad * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_GamePad_nCreate (JNIEnv * env, jclass clazz) { printf("GamePad not implemented yet!\n"); return JNI_FALSE; } /* * Class: org_lwjgl_input_GamePad * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nDestroy (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_GamePad * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nPoll (JNIEnv * env, jclass clazz, jint buf) { } /* * Class: org_lwjgl_input_GamePad * Method: nRead * Signature: (I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nRead (JNIEnv * env, jclass clazz, jint buf) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nEnableBuffer (JNIEnv * env, jclass clazz) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nGetNumButtons * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nGetNumButtons (JNIEnv * env, jclass clazz) { return 0; } --- NEW FILE: org_lwjgl_input_Joystick.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Joystick.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_Joystick.cpp,v 1.1 2002/11/20 16:11:39 elias_naur Exp $ * * Win32 analogue joystick handling. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_input_Joystick.h" /** * Initializes any field ids */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_initIDs(JNIEnv * env, jclass clazz) { } /** * Called when the Joystick instance is to be created */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nCreate(JNIEnv *env, jclass clazz) { return JNI_FALSE; } /* * Class: org_lwjgl_input_Joystick * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nDestroy(JNIEnv *env, jclass clazz) { } /* * Class: org_lwjgl_input_Joystick * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nPoll(JNIEnv * env, jclass clazz) { } |
From: Elias N. <eli...@us...> - 2002-11-20 13:55:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv18571 Modified Files: org_lwjgl_Display.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp Log Message: Fixed a viewport placement bug 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Mouse.cpp 20 Nov 2002 10:33:37 -0000 1.2 +++ org_lwjgl_input_Mouse.cpp 20 Nov 2002 13:54:58 -0000 1.3 @@ -42,6 +42,7 @@ #include <X11/X.h> #include <X11/Xlib.h> +#include <X11/extensions/xf86vmode.h> #include <assert.h> #include <string.h> #include "org_lwjgl_input_Mouse.h" @@ -50,6 +51,7 @@ extern Display *disp; extern Window win; +extern int screen; extern int current_fullscreen; int pointer_grabbed; @@ -124,9 +126,10 @@ int grabPointer(void) { int result; int mask = EnterWindowMask | LeaveWindowMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask; - if (current_fullscreen) + if (current_fullscreen) { result = XGrabPointer(disp, win, False, mask, GrabModeAsync, GrabModeAsync, win, blank_cursor, CurrentTime); - else + XF86VidModeSetViewPort(disp, screen, 0, 0); // make sure we have a centered window + } else result = XGrabPointer(disp, win, False, mask, GrabModeAsync, GrabModeAsync, None, blank_cursor, CurrentTime); if (result == GrabSuccess) pointer_grabbed = 1; |
From: Elias N. <eli...@us...> - 2002-11-20 10:33:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv8852 Modified Files: org_lwjgl_Display.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp Log Message: Improved pointer and keyboard handling under windowed mode 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Display.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_Display.cpp 20 Nov 2002 10:33:37 -0000 1.2 @@ -55,6 +55,7 @@ Display * disp; int screen; int current_fullscreen; +int current_focused; Window win; XF86VidModeModeInfo **avail_modes; XVisualInfo * vis_info; @@ -67,18 +68,29 @@ } while ((event.type != MapNotify) || (event.xmap.event != win)); } +int isFocused(void) { + XEvent event; + while (XCheckMaskEvent(disp, EnterWindowMask | LeaveWindowMask, &event)) { + if (event.type == EnterNotify) + current_focused = 1; + else if (event.type == LeaveNotify) + current_focused = 0; + } + return current_focused; +} + int getDisplayModes(Display *disp, int screen, int *num_modes, XF86VidModeModeInfo ***avail_modes) { int event_base, error_base, xvid_ver, xvid_rev; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { #ifdef _DEBUG - printf("XF86VidMode extention not available\n"); + printf("XF86VidMode extension not available\n"); #endif return 0; } XF86VidModeQueryVersion(disp, &xvid_ver, &xvid_rev); #ifdef _DEBUG - printf("XF86VidMode extention version %i.%i\n", xvid_ver, xvid_rev); + printf("XF86VidMode extension version %i.%i\n", xvid_ver, xvid_rev); #endif XF86VidModeGetAllModeLines(disp, screen, num_modes, avail_modes); return 1; @@ -94,6 +106,7 @@ int num_modes, i; current_fullscreen = fullscreen; + current_focused = 0; disp = XOpenDisplay(NULL); if (disp == NULL) { #ifdef _DEBUG @@ -122,9 +135,8 @@ cmap = XCreateColormap(disp, root_win, vis_info->visual, AllocNone); attribs.colormap = cmap; - attribs.event_mask = ExposureMask | FocusChangeMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; + attribs.event_mask = StructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; attribs.background_pixel = 0xFF000000; - attribs.event_mask = StructureNotifyMask; attribmask = CWColormap | CWBackPixel | CWEventMask; if (fullscreen) { attribmask |= CWOverrideRedirect; @@ -134,9 +146,9 @@ #ifdef _DEBUG printf("Created window\n"); #endif + XMapRaised(disp, win); + waitMapped(disp, win); if (fullscreen) { - XMapRaised(disp, win); - waitMapped(disp, win); for ( i = 0; i < num_modes; ++i ) { #ifdef _DEBUG printf("Mode %d: %dx%d\n", i, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay); @@ -155,13 +167,10 @@ } } XF86VidModeSetViewPort(disp, screen, 0, 0); - } else { - XMapWindow(disp, win); - waitMapped(disp, win); } XClearWindow(disp, win); XSync(disp, True); - + isFocused(); return JNI_TRUE; } 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Keyboard.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_input_Keyboard.cpp 20 Nov 2002 10:33:37 -0000 1.2 @@ -52,8 +52,13 @@ jfieldID fid_readBufferAddress; unsigned char key_buf[KEYBOARD_SIZE]; +int keyboard_grabbed; + extern Display *disp; extern Window win; +extern int current_fullscreen; + +extern int isFocused(void); /* * Class: org_lwjgl_input_Keyboard @@ -74,6 +79,34 @@ fid_readBufferAddress = env->GetStaticFieldID(clazz, "readBufferAddress", "I"); } +int grabKeyboard(void) { + int result = XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); + if (result == GrabSuccess) + keyboard_grabbed = 1; + return result; +} + +void ungrabKeyboard(void) { + keyboard_grabbed = 0; + XUngrabKeyboard(disp, CurrentTime); +} + +int updateKeyboardGrab(void) { + if (current_fullscreen) { + if (!keyboard_grabbed) + return grabKeyboard(); + } else { + if (isFocused()) { + if (!keyboard_grabbed) + return grabKeyboard(); + } else { + if (keyboard_grabbed) + ungrabKeyboard(); + } + } + return GrabSuccess; +} + /* * Class: org_lwjgl_input_Keyboard * Method: nCreate @@ -82,8 +115,8 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { - int result = XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); - if (result != GrabSuccess) { + keyboard_grabbed = 0; + if (updateKeyboardGrab() != GrabSuccess) { #ifdef _DEBUG printf("Could not grab keyboard\n"); #endif @@ -101,13 +134,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { - XUngrabKeyboard(disp, CurrentTime); + ungrabKeyboard(); } int checkKeyEvents(unsigned char *result_buf) { XEvent event; int count = 0; int buf_count = 0; + updateKeyboardGrab(); while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { unsigned char keycode = (unsigned char)((event.xkey.keycode - 8) & 0xff); if (result_buf != NULL) { 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Mouse.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_input_Mouse.cpp 20 Nov 2002 10:33:37 -0000 1.2 @@ -50,6 +50,9 @@ extern Display *disp; extern Window win; +extern int current_fullscreen; + +int pointer_grabbed; jfieldID fid_button; jfieldID fid_dx; @@ -66,6 +69,8 @@ Cursor blank_cursor; +extern int isFocused(void); + /* * Class: org_lwjgl_input_Mouse * Method: initIDs @@ -113,10 +118,42 @@ XColor dummy_color; blank_cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0); XFreePixmap(disp, mask); - XDefineCursor(disp, win, blank_cursor); return 1; } +int grabPointer(void) { + int result; + int mask = EnterWindowMask | LeaveWindowMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask; + if (current_fullscreen) + result = XGrabPointer(disp, win, False, mask, GrabModeAsync, GrabModeAsync, win, blank_cursor, CurrentTime); + else + result = XGrabPointer(disp, win, False, mask, GrabModeAsync, GrabModeAsync, None, blank_cursor, CurrentTime); + if (result == GrabSuccess) + pointer_grabbed = 1; + return result; +} + +void ungrabPointer(void) { + pointer_grabbed = 0; + XUngrabPointer(disp, CurrentTime); +} + +int updatePointerGrab(void) { + if (current_fullscreen) { + if (!pointer_grabbed) + return grabPointer(); + } else { + if (isFocused()) { + if (!pointer_grabbed) + return grabPointer(); + } else { + if (pointer_grabbed) + ungrabPointer(); + } + } + return GrabSuccess; +} + /* * Class: org_lwjgl_input_Mouse * Method: nCreate @@ -126,19 +163,19 @@ (JNIEnv * env, jclass clazz) { int i; - current_x = current_y = current_z = last_x = last_y = last_z = 0; + + current_x = current_y = current_z = last_x = last_y = last_z = pointer_grabbed = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; if (!blankCursor()) { #ifdef _DEBUG - printf("Could not blank cursor\n"); + printf("Could create blank cursor\n"); #endif return JNI_FALSE; } - int result = XGrabPointer(disp, win, False, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); - if (result != GrabSuccess) { + if (updatePointerGrab() != GrabSuccess) { #ifdef _DEBUG - printf("Could not grab mouse\n"); + printf("Could not grab pointer\n"); #endif return JNI_FALSE; } @@ -172,14 +209,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { - XUndefineCursor(disp, win); + if (pointer_grabbed) + ungrabPointer(); XFreeCursor(disp, blank_cursor); - XUngrabPointer(disp, CurrentTime); } int checkPointer() { XEvent event; int count = 0; + updatePointerGrab(); while (XCheckMaskEvent(disp, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, &event)) { count++; switch (event.type) { |
From: Brian M. <ma...@us...> - 2002-11-19 17:15:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/test In directory sc8-pr-cvs1:/tmp/cvs-serv4305 Removed Files: JoystickTest.java Log Message: moved tests to org.lwjgl.test for easier seperation --- JoystickTest.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/test/JoystickTest.java |
From: Brian M. <ma...@us...> - 2002-11-19 16:48:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/test In directory sc8-pr-cvs1:/tmp/cvs-serv3766 Removed Files: Game.java Log Message: moved tests to org.lwjgl.test for easier seperation --- Game.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/test/Game.java |
From: Brian M. <ma...@us...> - 2002-11-19 16:48:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/vector In directory sc8-pr-cvs1:/tmp/cvs-serv3465/vector Added Files: MathTest.java Log Message: moved tests to org.lwjgl.test for easier seperation --- NEW FILE: MathTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/vector/MathTest.java package org.lwjgl.test.vector; import java.nio.*; import org.lwjgl.*; public class MathTest { public static void main(String[] args) { ByteBuffer buf = ByteBuffer.allocateDirect(100); buf.order(ByteOrder.nativeOrder()); FloatBuffer float_buf = buf.asFloatBuffer(); float f = 0f; while (float_buf.hasRemaining()) { f += 0.5f; float_buf.put(f); } float_buf.rewind(); System.out.println("Src buffer:"); while (float_buf.hasRemaining()) System.out.print(float_buf.get() + " "); System.out.println(""); int buf_address = Sys.getDirectBufferAddress(float_buf); org.lwjgl.Math.matrixOp(org.lwjgl.Math.MATRIXOP_NEGATE, buf_address, 0, 100, 1, 1, false, buf_address, 0, false); System.out.println("Negated result:"); float_buf.rewind(); while (float_buf.hasRemaining()) System.out.print(float_buf.get() + " "); System.out.println(""); } } |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv3465/openal Added Files: ALCTest.java ALTest.java ALUTTest.java BasicTest.java EAXTest.java PlayTest.java PlayTestMemory.java Log Message: moved tests to org.lwjgl.test for easier seperation --- NEW FILE: ALCTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; import org.lwjgl.Sys; import java.nio.IntBuffer; /** * $Id: ALCTest.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This is a test for the ALC part of OpenAL * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class ALCTest extends BasicTest { /** * Creates an instance of ALCTest */ public ALCTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { //error stuff int lastError = ALC.NO_ERROR; //create a device device = alc.openDevice(null); if(device == null) { System.out.println("Unable to create device"); System.exit(-1); } //create attribute list for context creation IntBuffer buffer = createIntBuffer(7); buffer.put(ALC.FREQUENCY); buffer.put(44100); buffer.put(ALC.REFRESH); buffer.put(15); buffer.put(ALC.SYNC); buffer.put(ALC.FALSE); buffer.put(0); //terminating int //create a context, using above attributes context = alc.createContext(device, Sys.getDirectBufferAddress(buffer)); if(context == null) { System.out.println("Unable to create context"); System.exit(-1); } if((lastError = alc.getError(device)) != ALC.NO_ERROR) { System.out.println("ALC Error: " + alc.getString(device, lastError)); System.exit(-1); } //make current alc.makeContextCurrent(context); //process alc.processContext(context); //suspend alc.suspendContext(context); //query System.out.println("DEFAULT_DEVICE_SPECIFIER: " + alc.getString(device, ALC.DEFAULT_DEVICE_SPECIFIER)); System.out.println("DEVICE_SPECIFIER: " + alc.getString(device, ALC.DEVICE_SPECIFIER)); System.out.println("EXTENSIONS: " + alc.getString(device, ALC.EXTENSIONS)); //mo query buffer.rewind(); alc.getIntegerv(device, ALC.MAJOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)); alc.getIntegerv(device, ALC.MINOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)+4); System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0)); System.out.println("ALC_MINOR_VERSION: " + buffer.get(1)); //no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it //is buggy on win32 - my dev platform //check current context ALCcontext currentContext = alc.getCurrentContext(); if(context.context != currentContext.context) { System.out.println("Serious error! - context copy != current context"); System.exit(-1); } //check contexts device ALCdevice currentDevice = alc.getContextsDevice(context); if(device.device != currentDevice.device) { System.out.println("Serious error! - device copy != current contexts device"); System.exit(-1); } //get an enumerstion value System.out.println("Value of ALC_MAJOR_VERSION: " + alc.getEnumValue(device, "ALC_MAJOR_VERSION")); //close context again alc.destroyContext(context); //close it alc.closeDevice(device); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { ALCTest alcTest = new ALCTest(); alcTest.execute(args); } } --- NEW FILE: ALTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * [...3243 lines suppressed...] if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceStopv : ", error); break; } } while (ch != 'Q'); // Delete the Sources al.deleteSources(numSources, Sys.getDirectBufferAddress(Sources)); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { ALTest alTest = new ALTest(); alTest.execute(args); } } --- NEW FILE: ALUTTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALUTTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * $Id: ALUTTest.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This is a basic play test using ALUT * Yes, over zealous use of getError ;) * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class ALUTTest extends BasicTest { /** * Creates an instance of ALUTTest */ public ALUTTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { if(args.length < 1) { System.out.println("please specify filename to play"); return; } int lastError; //initialize AL, using ALUT alut.init(args); //create 1 buffer and 1 source ByteBuffer buffers = ByteBuffer.allocateDirect(4); buffers.order(ByteOrder.nativeOrder()); ByteBuffer sources = ByteBuffer.allocateDirect(4); sources.order(ByteOrder.nativeOrder()); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //load wave data ALUTLoadWAVData file = alut.loadWAVFile(args[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //copy to buffers al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //unload file again alut.unloadWAV(file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //set up source input al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 al.sourcePlay(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //wait 5 secs try { System.out.println("Waiting 5 seconds for sound to complete"); Thread.sleep(5000); } catch (InterruptedException inte) { } //stop source 0 al.sourceStop(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //shutdown using ALUT alut.exit(); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { ALUTTest alutTest = new ALUTTest(); alutTest.execute(args); } } --- NEW FILE: BasicTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.ALUT; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; /** * $Id: BasicTest.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This is a basic test, which contains the most used stuff * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public abstract class BasicTest { /** OpenAL instance */ protected AL al; /** OpenAL Context instance */ protected ALC alc; /** OpenAL Util library instance */ protected ALUT alut; /** OpenAL context */ protected ALCcontext context; /** OpenAL device */ protected ALCdevice device; /** * Creates an instance of PlayTest */ public BasicTest() { al = new AL(); try { al.create(); } catch (Exception e) { e.printStackTrace(); return; } alc = new ALC(); try { alc.create(); } catch (Exception e) { e.printStackTrace(); return; } alut = new ALUT(); try { alut.create(); } catch (Exception e) { e.printStackTrace(); return; } } /** * Initializes OpenAL */ protected void alInitialize() { //get default device device = alc.openDevice(null); if(device == null) { throw new RuntimeException("Error creating device"); } //create context (no attributes specified) context = alc.createContext(device, 0); if(context == null) { throw new RuntimeException("Error creating context"); } //make context current alc.makeContextCurrent(context); if(alc.getError(device) != ALC.NO_ERROR) { throw new RuntimeException("An error occurred while making context current"); } } /** * Creates an integer buffer to hold specified ints * - strictly a utility method * * @param size how many int to contain * @return created IntBuffer */ protected IntBuffer createIntBuffer(int size) { ByteBuffer temp = ByteBuffer.allocateDirect(4*size); temp.order(ByteOrder.nativeOrder()); return temp.asIntBuffer(); } /** * Exits the test NOW, printing errorcode to stdout * * @param error Error code causing exit */ protected void exit(int error) { System.out.println("OpenAL Error: " + al.getString(error)); alut.exit(); System.exit(-1); } } --- NEW FILE: EAXTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.openal.eax.EAX; import org.lwjgl.openal.eax.EAXBufferProperties; import java.nio.IntBuffer; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; /** * $Id: EAXTest.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This test initializes EAX and tries to get and set some EAX values * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAXTest extends BasicTest { /** * Creates an instance of EAXTest */ public EAXTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { alInitialize(); EAX eax = new EAX(); try { eax.create(); } catch (Exception e) { e.printStackTrace(); return; } System.out.print("EAX supported..."); //no errorchecking from now on, since our context is gone. //shutdown alc.makeContextCurrent(null); alc.destroyContext(context); alc.closeDevice(device); System.out.println("test done."); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { EAXTest eaxTest = new EAXTest(); eaxTest.execute(args); } } --- NEW FILE: PlayTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; import java.nio.IntBuffer; /** * $Id: PlayTest.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This is a basic play test * Yes, over zealous use of getError ;) * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class PlayTest extends BasicTest { /** * Creates an instance of PlayTest */ public PlayTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { if(args.length < 1) { System.out.println("please specify filename to play"); return; } int lastError; //initialize AL, using ALC alInitialize(); //create 1 buffer and 1 source IntBuffer buffers = createIntBuffer(1); IntBuffer sources = createIntBuffer(1); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //load wave data ALUTLoadWAVData file = alut.loadWAVFile(args[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //copy to buffers al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //unload file again alut.unloadWAV(file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //set up source input al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 al.sourcePlay(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //wait 5 secs try { System.out.println("Waiting 5 seconds for sound to complete"); Thread.sleep(5000); } catch (InterruptedException inte) { } //stop source 0 al.sourceStop(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //no errorchecking from now on, since our context is gone. //shutdown alc.makeContextCurrent(null); alc.destroyContext(context); alc.closeDevice(device); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { PlayTest playTest = new PlayTest(); playTest.execute(args); } } --- NEW FILE: PlayTestMemory.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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.test.openal; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.net.MalformedURLException; import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; /** * $Id: PlayTestMemory.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * This is a basic play test * Yes, over zealous use of getError ;) * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class PlayTestMemory extends BasicTest { /** * Creates an instance of PlayTestMemory */ public PlayTestMemory() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { if(args.length < 1) { System.out.println("please specify filename to play"); return; } int lastError; //initialize AL, using ALC alInitialize(); //create 1 buffer and 1 source IntBuffer buffers = createIntBuffer(1); IntBuffer sources = createIntBuffer(1); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //load wave data ByteBuffer filebuffer = getData(args[0]); if(filebuffer == null) { System.out.println("Error loading file: " + args[0]); System.exit(-1); } ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //copy to buffers al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //unload file again alut.unloadWAV(file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //set up source input al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 al.sourcePlay(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //wait 5 secs try { System.out.println("Waiting 5 seconds for sound to complete"); Thread.sleep(5000); } catch (InterruptedException inte) { } //stop source 0 al.sourceStop(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //no errorchecking from now on, since our context is gone. //shutdown alc.makeContextCurrent(null); alc.destroyContext(context); alc.closeDevice(device); } /** * Reads the file into a ByteBuffer * * @param filename Name of file to load * @return ByteBuffer containing file data */ protected ByteBuffer getData(String filename) { ByteBuffer buffer = null; URL url = null; String cwd = System.getProperty("user.dir"); try { url = new URL("file:///" + cwd + "/" + filename); } catch (MalformedURLException mue) { mue.printStackTrace(); } System.out.println("Attempting to load: " + url); try { BufferedInputStream bis = new BufferedInputStream(url.openStream()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bufferLength = 4096; byte[] readBuffer = new byte[bufferLength]; int read = -1; while((read = bis.read(readBuffer, 0, bufferLength)) != -1) { baos.write(readBuffer, 0, read); } //done reading, close bis.close(); buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); } catch (Exception ioe) { ioe.printStackTrace(); } return buffer; } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { PlayTestMemory playTestMemory = new PlayTestMemory(); playTestMemory.execute(args); } } |
From: Brian M. <ma...@us...> - 2002-11-19 16:48:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv3465/opengl Added Files: Game.java Log Message: moved tests to org.lwjgl.test for easier seperation --- NEW FILE: Game.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Game.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ /** * $Id: Game.java,v 1.1 2002/11/19 16:48:25 matzon Exp $ * * Simple java test program. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ package org.lwjgl.test.opengl; import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; import java.nio.*; public final class Game { static { try { DisplayMode[] modes = Display.getAvailableDisplayModes(); System.out.println("Available display modes:"); for (int i = 0; i < modes.length; i ++) System.out.println(modes[i]); // For now let's just pick a mode we're certain to have Display.create(new DisplayMode(640, 480, 16, 60), true); System.out.println("Created display."); } catch (Exception e) { System.err.println("Failed to create display due to "+e); System.exit(1); } } public static final GL gl = new GL(16, 0, 16, 8); public static final GLU glu = new GLU(gl); static { try { gl.create(); System.out.println("Created OpenGL."); } catch (Exception e) { System.err.println("Failed to create OpenGL due to "+e); System.exit(1); } } /** Is the game finished? */ private static boolean finished; /** A rotating square! */ private static float angle; /** * No construction allowed */ private Game() { } public static void main(String[] arguments) { try { init(); while (!finished) { // Keyboard.poll(); mainLoop(); render(); gl.swapBuffers(); } } catch (Throwable t) { t.printStackTrace(); } finally { cleanup(); } } /** * All calculations are done in here */ private static void mainLoop() { angle += 1f; if (angle > 360.0f) angle = 0.0f; Mouse.poll(); if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dz != 0) System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dz); for (int i = 0; i < 8; i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); /* Keyboard.poll(); if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) finished = true;*/ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) finished = true; if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) System.out.println("Current time: " + Sys.getTime()); } } /** * All rendering is done in here */ private static void render() { gl.clear(GL.COLOR_BUFFER_BIT); gl.pushMatrix(); gl.translatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f); gl.rotatef(angle, 0, 0, 1.0f); gl.begin(GL.QUADS); gl.vertex2i(-50, -50); gl.vertex2i(50, -50); gl.vertex2i(50, 50); gl.vertex2i(-50, 50); gl.end(); gl.popMatrix(); } /** * Initialize */ private static void init() throws Exception { Keyboard.create(); Keyboard.enableBuffer(); Mouse.create(); Sys.setTime(0); Sys.setProcessPriority(Sys.REALTIME_PRIORITY); System.out.println("Timer resolution: " + Sys.getTimerResolution()); // Go into orthographic projection mode. gl.matrixMode(GL.PROJECTION); gl.loadIdentity(); glu.ortho2D(0, Display.getWidth(), 0, Display.getHeight()); gl.matrixMode(GL.MODELVIEW); gl.loadIdentity(); gl.viewport(0, 0, Display.getWidth(), Display.getHeight()); ByteBuffer num_tex_units_buf = ByteBuffer.allocateDirect(4); num_tex_units_buf.order(ByteOrder.nativeOrder()); int buf_addr = Sys.getDirectBufferAddress(num_tex_units_buf); gl.getIntegerv(GL.MAX_TEXTURE_UNITS_ARB, buf_addr); System.out.println("Number of texture units: " + num_tex_units_buf.getInt()); // Fix the refresh rate to the display frequency. // gl.wglSwapIntervalEXT(1); } /** * Cleanup */ private static void cleanup() { Keyboard.destroy(); Mouse.destroy(); gl.destroy(); Display.destroy(); } } |
From: Brian M. <ma...@us...> - 2002-11-19 16:48:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv3465 Removed Files: MathTest.java Log Message: moved tests to org.lwjgl.test for easier seperation --- MathTest.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/MathTest.java |
From: Brian M. <ma...@us...> - 2002-11-19 16:48:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv3465/input Added Files: JoystickTest.java Log Message: moved tests to org.lwjgl.test for easier seperation --- NEW FILE: JoystickTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/JoystickTest.java /* * JoystickTest.java * * Created on 13. november 2002, 22:49 */ package org.lwjgl.test.input; import java.awt.*; import java.awt.event.*; import org.lwjgl.input.Joystick; /** * * @author Brian Matzon */ public class JoystickTest extends Panel { private int counter = 0; public Thread animationThread; /** Creates a new instance of JoystickTest */ public JoystickTest() { try { Joystick.create(); } catch (Exception e) { e.printStackTrace(); return; } animationThread = new Thread() { public void run() { while (true) { paint(getGraphics()); try { Thread.sleep(250); } catch (InterruptedException inte) { inte.printStackTrace(); } } } }; animationThread.setDaemon(true); } public void paint(Graphics g) { if (g == null) { return; } g.setColor(Color.white); g.fillRect(0, 0, 640, 480); int y = 100; int x = 100; Joystick.poll(); g.setColor(Color.blue); g.drawString("Buttoncount: " + Joystick.buttonCount, x, y); y += 20; g.drawString("-----------------------------------------------", x, y); y += 20; g.drawString("x : " + Joystick.x, x, y); y += 20; g.drawString("y : " + Joystick.y, x, y); y += 20; if(Joystick.hasZAxis) { g.drawString("z : " + Joystick.z, x, y); y += 20; } if(Joystick.hasPOV) { g.drawString("pov: " + Joystick.pov, x, y); y += 20; } //paint buttons g.drawString("btn: ", x, y); x += g.getFontMetrics().stringWidth("btn: "); for(int i=0; i<Joystick.buttonCount; i++) { if(Joystick.isButtonDown(i)) { g.drawString(i + ", ", x, y); x+= 15; } } } public void update(Graphics g) { paint(g); } public void disposing() { Joystick.destroy(); } /** * @param args the command line arguments */ public static void main(String[] args) { final JoystickTest p = new JoystickTest(); final Frame f = new Frame(); f.setLayout(null); f.setSize(640, 480); f.setLocation(100, 100); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { f.hide(); p.disposing(); f.dispose(); } }); p.setSize(640, 480); p.setLocation(0, 0); p.setBackground(Color.RED); f.add(p); f.show(); p.animationThread.start(); } } |
From: Brian M. <ma...@us...> - 2002-11-19 16:47:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv2998/opengl Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl added to the repository |
From: Brian M. <ma...@us...> - 2002-11-19 16:47:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv2921/openal Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal added to the repository |
From: Brian M. <ma...@us...> - 2002-11-19 16:42:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv684/input Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input added to the repository |
From: Brian M. <ma...@us...> - 2002-11-19 16:41:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/vector In directory sc8-pr-cvs1:/tmp/cvs-serv406/vector Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/vector added to the repository |
From: Brian M. <ma...@us...> - 2002-11-19 16:40:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv32309 Modified Files: org_lwjgl_openal_CoreAL.h Log Message: mod: getSource3f removed, since it isn't in the specs Index: org_lwjgl_openal_CoreAL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_CoreAL.h 6 Sep 2002 23:36:34 -0000 1.7 +++ org_lwjgl_openal_CoreAL.h 19 Nov 2002 16:39:57 -0000 1.8 @@ -305,14 +305,6 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: getSource3f - * Signature: (IIIII)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSource3f - (JNIEnv *, jobject, jint, jint, jint, jint, jint); - -/* - * Class: org_lwjgl_openal_CoreAL * Method: getSourcefv * Signature: (III)V */ |
From: Brian M. <ma...@us...> - 2002-11-19 16:35:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv30251 Modified Files: CoreAL.java Log Message: mod: getSource3f removed, since it isn't in the specs Index: CoreAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CoreAL.java 6 Sep 2002 23:35:55 -0000 1.9 +++ CoreAL.java 19 Nov 2002 16:35:21 -0000 1.10 @@ -322,17 +322,6 @@ public native void getSourcef(int source, int pname, int floatdata); /** - * Gets a set of three floating point values from a source. - * - * @param source Source to get property from - * @param pname property to get - * @param v1 bytebuffer address to write float 1 to - * @param v2 bytebuffer address to write float 2 to - * @param v3 bytebuffer address to write float 3 to - */ - public native void getSource3f(int source, int pname, int v1, int v2, int v3); - - /** * Gets a floating point vector property from a Source object. * * @param source Source to get property from |
From: Elias N. <eli...@us...> - 2002-11-19 15:48:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv10506 Modified Files: org_lwjgl_openal_CoreAL.cpp Log Message: removed alGetSource3f Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_CoreAL.cpp 19 Nov 2002 15:22:28 -0000 1.2 +++ org_lwjgl_openal_CoreAL.cpp 19 Nov 2002 15:48:38 -0000 1.3 @@ -432,18 +432,6 @@ CHECK_AL_ERROR } -/* - * This function retrieves a set of three floating point values from a property of a source. - * - * C Specification: - * ALvoid alGetSource3f(ALuint source, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSource3f (JNIEnv *env, jobject obj, jint source, jint pname, jint v1, jint v2, jint v3) { -#warning FIXME: alGetSource3f -/* alGetSource3f((ALuint) source, (ALenum) pname, (ALfloat*) v1, (ALfloat*) v2, (ALfloat*) v3);*/ - CHECK_AL_ERROR -} - /** * This function retrieves a floating point-vector property of a source. * |
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv10107 Added Files: org_lwjgl_openal_eax_BaseEAX.cpp org_lwjgl_openal_eax_CoreEAX.cpp Removed Files: org_lwjgl_opengl_eax_BaseEAX.cpp org_lwjgl_opengl_eax_CoreEAX.cpp Log Message: opengl->openal (doh!) --- NEW FILE: org_lwjgl_openal_eax_BaseEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_BaseEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ #include "org_lwjgl_openal_eax_BaseEAX.h" /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nDestroy (JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_openal_eax_CoreEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_CoreEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_openal_eax_CoreEAX.cpp,v 1.1 2002/11/19 15:47:31 matzon Exp $ * * This is the actual JNI implementation of the OpenAL EAX library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_eax_CoreEAX.h" #include "checkALerror.h" #include "extal.h" /** * Throws an OAL exception with the specified message */ void ThrowException(JNIEnv *env, const char* message) { jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); env->ThrowNew(cls, message); } /* * Determines available EAX extensions */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; //check that we have a current context if(alcGetCurrentContext() == NULL) { ThrowException(env, "Unable to determine EAX Extensions: No current context"); } //check for extension, and assign if available if(alIsExtensionPresent((ALubyte*) "EAX")) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); } //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); } #else ThrowException(env, "EAX extensions not supported"); #endif } JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID (JNIEnv *env, jobject obj) { #ifdef _WIN32 //get class/fields jclass eax_class = env->FindClass("org/lwjgl/openal/eax/CoreEAX"); jfieldID eaxBuffer_field = env->GetStaticFieldID(eax_class, "BUFFER_GUID", "I"); jfieldID eaxListener_field = env->GetStaticFieldID(eax_class, "LISTENER_GUID", "I"); //set fields env->SetStaticIntField(eax_class, eaxBuffer_field, (jint) &DSPROPSETID_EAX20_BufferProperties); env->SetStaticIntField(eax_class, eaxListener_field, (jint) &DSPROPSETID_EAX20_ListenerProperties); #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function retrieves an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } /* * This function sets an EAX value. * * C Specification: * ALenum EAXSet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } --- org_lwjgl_opengl_eax_BaseEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_BaseEAX.cpp --- org_lwjgl_opengl_eax_CoreEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_CoreEAX.cpp |
From: Elias N. <eli...@us...> - 2002-11-19 15:22:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv31700 Modified Files: extal.c org_lwjgl_Math.cpp org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_CoreAL.cpp org_lwjgl_openal_eax_CoreEAX.cpp org_lwjgl_opengl_GL.cpp Log Message: Corrected author tags Index: extal.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extal.c 19 Nov 2002 15:17:45 -0000 1.1 +++ extal.c 19 Nov 2002 15:22:27 -0000 1.2 @@ -36,6 +36,6 @@ * * This file contains the AL extension assigning mechanism * - * @author Brian Matzon <br...@ma...> + * @author elias_naur <eli...@ma...> * @version $Revision$ - */ \ No newline at end of file + */ Index: org_lwjgl_Math.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Math.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Math.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Math.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_Math.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Win32 maths library. + * linux maths library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Win32 math library. + * linux math library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_ALC.cpp 19 Nov 2002 14:08:21 -0000 1.1 +++ org_lwjgl_openal_ALC.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -35,7 +35,7 @@ * * This is the actual JNI implementation of the OpenAL context/device library. * - * @author Brian Matzon <br...@ma...> + * @author elias_naur <eli...@ma...> * @version $Revision$ */ #include "org_lwjgl_openal_ALC.h" Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_ALUT.cpp 19 Nov 2002 14:08:21 -0000 1.1 +++ org_lwjgl_openal_ALUT.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -36,7 +36,7 @@ * This is the actual JNI implementation of the OpenAL utility library. * It handles whatever is needed for proper OpenAL support via using Java. * - * @author Brian Matzon <br...@ma...> + * @author elias_naur <eli...@ma...> * @version $Revision$ */ #include "org_lwjgl_openal_ALUT.h" Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_CoreAL.cpp 19 Nov 2002 14:08:21 -0000 1.1 +++ org_lwjgl_openal_CoreAL.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -36,7 +36,7 @@ * This is the actual JNI implementation of the OpenAL core. It handles * whatever is needed for proper OpenAL support via using Java. * - * @author Brian Matzon <br...@ma...> + * @author elias_naur <eli...@ma...> * @version $Revision$ */ #include "org_lwjgl_openal_CoreAL.h" Index: org_lwjgl_openal_eax_CoreEAX.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_CoreEAX.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_CoreEAX.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_eax_CoreEAX.cpp 19 Nov 2002 14:33:49 -0000 1.1 +++ org_lwjgl_openal_eax_CoreEAX.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -35,7 +35,7 @@ * * This is the actual JNI implementation of the OpenAL EAX library. * - * @author Brian Matzon <br...@ma...> + * @author elias_naur <eli...@ma...> * @version $Revision$ */ #include "org_lwjgl_openal_eax_CoreEAX.h" Index: org_lwjgl_opengl_GL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GL.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_GL.cpp 19 Nov 2002 08:50:57 -0000 1.1 +++ org_lwjgl_opengl_GL.cpp 19 Nov 2002 15:22:28 -0000 1.2 @@ -35,7 +35,7 @@ * * GL extensions library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ |
From: Elias N. <eli...@us...> - 2002-11-19 15:17:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv29952 Added Files: extal.c Log Message: linux extal.h --- NEW FILE: extal.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extal.c /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ #include "extal.h" /** * $Id: extal.c,v 1.1 2002/11/19 15:17:45 elias_naur Exp $ * * This file contains the AL extension assigning mechanism * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ |
From: Elias N. <eli...@us...> - 2002-11-19 14:58:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv22028 Modified Files: Makefile Log Message: Updated linux Makefile Index: Makefile CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 19 Nov 2002 14:08:21 -0000 1.8 +++ Makefile 19 Nov 2002 14:58:34 -0000 1.9 @@ -39,7 +39,8 @@ # version $Revision$ # -GCC = g++ +GCC = gcc +G++ = g++ LINK = g++ JAVAHOME=/usr/java/j2sdk1.4.1_01 LIBCSRC=../common/extgl.c @@ -61,9 +62,12 @@ $(LINK) -shared -o $@ $^ $(LINKOPTS) cp $@ ../../../bin/ -.SUFFIXES: .cpp .so .o .java .h .class +.SUFFIXES: .cpp .so .o .java .h .class .c %.o : %.cpp + $(G++) $(DEBUG_FLAGS) -Wall -I$(JAVAHOME)/include -I../common -I$(JAVAHOME)/include/linux -c -o $@ $< + +%.o : %.c $(GCC) $(DEBUG_FLAGS) -Wall -I$(JAVAHOME)/include -I../common -I$(JAVAHOME)/include/linux -c -o $@ $< testprog : main.o |
From: Elias N. <eli...@us...> - 2002-11-19 14:38:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv14644 Added Files: checkALerror.h Log Message: Added linux specific checkALerror.h --- NEW FILE: checkALerror.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/checkALerror.h /* checkGLerror.h Author: C. Prince Created: 8 November 2001 Error checking for OpenGL bindings */ #ifndef _CHECKGLERROR_H_INCLUDED_ #define _CHECKGLERROR_H_INCLUDED_ #ifdef _DEBUG #include <jni.h> #include <AL/al.h> #define CHECK_AL_ERROR \ { \ int err = alGetError(); \ if (err != AL_NO_ERROR) { \ jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ env->ThrowNew(cls, (const char*) alGetString(err)); \ env->DeleteLocalRef(cls); \ } \ } /* only available if deviceaddress is specified in method */ #define CHECK_ALC_ERROR \ { \ int err = alcGetError((ALCdevice*) deviceaddress); \ if (err != AL_NO_ERROR) { \ jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ env->ThrowNew(cls, (const char*) alcGetString((ALCdevice*) deviceaddress, err)); \ env->DeleteLocalRef(cls); \ } \ } #else #define CHECK_AL_ERROR #define CHECK_ALC_ERROR #endif /* _DEBUG */ #endif /* _CHECKGLERROR_H_INCLUDED_ */ |
From: Elias N. <eli...@us...> - 2002-11-19 14:33:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv12991 Modified Files: org_lwjgl_openal_BaseAL.cpp Added Files: org_lwjgl_openal_eax_BaseEAX.cpp org_lwjgl_openal_eax_CoreEAX.cpp Log Message: Added EAX linux files --- NEW FILE: org_lwjgl_openal_eax_BaseEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_BaseEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ #include "org_lwjgl_openal_eax_BaseEAX.h" /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nCreate (JNIEnv *env, jobject obj) { return false; } /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nDestroy (JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_openal_eax_CoreEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_CoreEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_openal_eax_CoreEAX.cpp,v 1.1 2002/11/19 14:33:49 elias_naur Exp $ * * This is the actual JNI implementation of the OpenAL EAX library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_eax_CoreEAX.h" #include "checkALerror.h" #include "extal.h" #include <AL/altypes.h> /** * Throws an OAL exception with the specified message */ void ThrowException(JNIEnv *env, const char* message) { jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); env->ThrowNew(cls, message); } /* * Determines available EAX extensions */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; //check that we have a current context if(alcGetCurrentContext() == NULL) { ThrowException(env, "Unable to determine EAX Extensions: No current context"); } //check for extension, and assign if available if(alIsExtensionPresent((ALubyte*) "EAX")) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); } //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); } #else ThrowException(env, "EAX extensions not supported"); #endif } JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID (JNIEnv *env, jobject obj) { #ifdef _WIN32 //get class/fields jclass eax_class = env->FindClass("org/lwjgl/openal/eax/CoreEAX"); jfieldID eaxBuffer_field = env->GetStaticFieldID(eax_class, "BUFFER_GUID", "I"); jfieldID eaxListener_field = env->GetStaticFieldID(eax_class, "LISTENER_GUID", "I"); //set fields env->SetStaticIntField(eax_class, eaxBuffer_field, (jint) &DSPROPSETID_EAX20_BufferProperties); env->SetStaticIntField(eax_class, eaxListener_field, (jint) &DSPROPSETID_EAX20_ListenerProperties); #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function retrieves an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_ILLEGAL_COMMAND; #endif } /* * This function sets an EAX value. * * C Specification: * ALenum EAXSet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_ILLEGAL_COMMAND; #endif } Index: org_lwjgl_openal_BaseAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_BaseAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_BaseAL.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_BaseAL.cpp 19 Nov 2002 14:08:21 -0000 1.1 +++ org_lwjgl_openal_BaseAL.cpp 19 Nov 2002 14:33:48 -0000 1.2 @@ -47,4 +47,4 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseAL_nDestroy(JNIEnv *env, jobject obj) { -} \ No newline at end of file +} |