You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(1) |
2
(14) |
3
(4) |
4
|
5
(3) |
6
(1) |
|
7
(9) |
8
(2) |
9
(4) |
10
|
11
(16) |
12
(21) |
13
(14) |
|
14
(12) |
15
(5) |
16
(6) |
17
|
18
(4) |
19
(4) |
20
(3) |
|
21
(2) |
22
(12) |
23
|
24
|
25
(8) |
26
|
27
(25) |
|
28
|
29
(2) |
30
(1) |
|
|
|
|
|
From: Elias N. <eli...@us...> - 2004-11-11 16:58:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21588/linux Modified Files: org_lwjgl_input_Cursor.c Log Message: Linux fix destroyCursor native function typo Index: org_lwjgl_input_Cursor.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Cursor.c 11 Nov 2004 13:42:25 -0000 1.3 +++ org_lwjgl_input_Cursor.c 11 Nov 2004 16:58:21 -0000 1.4 @@ -84,11 +84,10 @@ XcursorImagesDestroy(cursor_images); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay__destroyCursor +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_destroyCursor (JNIEnv *env, jobject this, jobject cursor_handle_buffer) { Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle_buffer); -// Cursor cursor = (Cursor)cursor_handle; XFreeCursor(getDisplay(), *cursor); decDisplay(); } |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:04:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9632/src/java/org/lwjgl/opengl Added Files: EventQueue.java MouseEventQueue.java Log Message: Added missing files --- NEW FILE: EventQueue.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; /** * A java implementation of a LWJGL compatible event queue. * Currently only used by the Mac OS X implementation. * @author elias_naur */ import java.nio.ByteBuffer; import java.nio.IntBuffer; abstract class EventQueue { private final static int QUEUE_SIZE = 200; private final int event_size; private final IntBuffer queue; public EventQueue(int event_size) { this.event_size = event_size; this.queue = ByteBuffer.allocateDirect(QUEUE_SIZE*event_size).asIntBuffer(); } protected synchronized void clearEvents() { queue.clear(); } /** * Copy available events into the specified buffer. * Note that the buffer position is maintained, to emulate * the behaviour of the native event queues. * @return the number of events copied */ public synchronized int copyEvents(IntBuffer dest) { int old_position = dest.position(); queue.flip(); int old_limit = queue.limit(); if (dest.remaining() < queue.remaining()) queue.limit(dest.remaining() + queue.position()); dest.put(queue); queue.limit(old_limit); queue.compact(); int num_events = (dest.position() - old_position)/event_size; dest.position(old_position); return num_events; } /** * Put an event into the queue. * @return true if the event fitted into the queue, false otherwise */ public synchronized boolean putEvent(int[] event) { if (event.length != event_size) throw new IllegalArgumentException("Internal error: event size " + event_size + " does not equals the given event size " + event.length); if (queue.remaining() >= event.length) { queue.put(event); return true; } else return false; } } --- NEW FILE: MouseEventQueue.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; /** * A java implementation of a LWJGL compatible Mouse event queue. * Currently only used by the Mac OS X implementation. * @author elias_naur */ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseEvent; import java.nio.IntBuffer; import java.nio.ByteBuffer; import org.lwjgl.BufferUtils; final class MouseEventQueue extends EventQueue implements MouseListener, MouseMotionListener, MouseWheelListener { private final static int WHEEL_SCALE = 120; public final static int NUM_BUTTONS = 3; private final static int EVENT_SIZE = 5; private final int width; private final int height; private boolean grabbed; private final IntBuffer delta_buffer = BufferUtils.createIntBuffer(2); /** The accumulated mouse deltas returned by poll() */ private int accum_dx; private int accum_dy; private int accum_dz; /** The last polled mouse position */ private int last_poll_x; private int last_poll_y; /** The last event mouse position */ private int last_event_x; private int last_event_y; /** Event scratch array */ private final int[] event = new int[EVENT_SIZE]; /** Buttons array */ private final byte[] buttons = new byte[NUM_BUTTONS]; public MouseEventQueue(int width, int height) { super(EVENT_SIZE); this.width = width; this.height = height; resetCursorToCenter(); } public synchronized void setGrabbed(boolean grabbed) { this.grabbed = grabbed; resetCursorToCenter(); } public synchronized boolean isGrabbed() { return grabbed; } private void resetCursorToCenter() { int center_x = width/2; int center_y = height - 1 - height/2; last_poll_x = center_x; last_poll_y = center_y; last_event_x = center_x; last_event_y = center_y; clearEvents(); accum_dx = accum_dy = 0; } private boolean putMouseEvent(int button, int state, int dx, int dy, int dz) { event[0] = button; event[1] = state; event[2] = dx; event[3] = dy; event[4] = dz; return putEvent(event); } public synchronized void poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer) { coord_buffer.put(0, accum_dx); coord_buffer.put(1, accum_dy); coord_buffer.put(2, accum_dz); accum_dx = accum_dy = accum_dz = 0; int old_position = buttons_buffer.position(); buttons_buffer.put(buttons, 0, buttons.length); buttons_buffer.position(old_position); } private synchronized void setCursorPos(int x, int y) { if (grabbed) return; int poll_dx = x - last_poll_x; int poll_dy = y - last_poll_y; accum_dx += poll_dx; accum_dy += poll_dy; last_poll_x = x; last_poll_y = y; int event_dx = x - last_event_x; int event_dy = y - last_event_y; if (putMouseEvent(-1, 0, event_dx, -event_dy, 0)) { last_event_x = x; last_event_y = y; } } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } private void handleButton(MouseEvent e) { byte button; switch (e.getButton()) { case MouseEvent.BUTTON1: button = (byte)0; break; case MouseEvent.BUTTON2: button = (byte)2; break; case MouseEvent.BUTTON3: button = (byte)1; break; default: throw new IllegalArgumentException("Not a valid button: " + e.getButton()); } byte state; switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: state = 1; break; case MouseEvent.MOUSE_RELEASED: state = 0; break; default: throw new IllegalArgumentException("Not a valid event ID: " + e.getID()); } setButton(button, state); } public void mousePressed(MouseEvent e) { updateDeltas(); handleButton(e); } private synchronized void setButton(byte button, byte state) { buttons[button] = state; putMouseEvent(button, state, 0, 0, 0); } public void mouseReleased(MouseEvent e) { updateDeltas(); handleButton(e); } public void mouseDragged(MouseEvent e) { setCursorPos(e.getX(), e.getY()); } public void mouseMoved(MouseEvent e) { setCursorPos(e.getX(), e.getY()); } private synchronized void handleWheel(int amount) { accum_dz += amount; putMouseEvent(-1, 0, 0, 0, amount); } public void updateDeltas() { if (!grabbed) return; synchronized (this) { ((MacOSXDisplay)Display.getImplementation()).getMouseDeltas(delta_buffer); int dx = delta_buffer.get(0); int dy = delta_buffer.get(1); if (dx != 0 || dy != 0) { putMouseEvent(-1, 0, dx, -dy, 0); accum_dx += dx; accum_dy += dy; } } } public void mouseWheelMoved(MouseWheelEvent e) { int wheel_amount = -e.getWheelRotation()*WHEEL_SCALE; updateDeltas(); handleWheel(wheel_amount); } } |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:03:55
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: Mac OS X port, second try :) Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- WindowCreationTest.java 15 Sep 2004 17:07:05 -0000 1.23 +++ WindowCreationTest.java 11 Nov 2004 16:03:15 -0000 1.24 @@ -74,9 +74,22 @@ System.out.println("Window created"); System.out.println(Display.getDisplayMode().getHeight() + ", " + Display.getDisplayMode().getWidth() + ", " + Display.getTitle()); + Display.setVSyncEnabled(true); + Display.setTitle("WindowCreationTest"); + float color = 0f; + int direction = 1; // wait for user to close window while(!Display.isCloseRequested()) { + GL11.glClearColor(color, color, color, 1f); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + color += direction*.05f; + if (color > 1f) { + color = 1f; + direction = -1*direction; + } else if (color < 0f) { + direction = -1*direction; + color = 0f; + } Display.update(); try { Thread.sleep(100); |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:03:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/java/org/lwjgl/input Modified Files: Keyboard.java Log Message: Mac OS X port, second try :) Index: Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- Keyboard.java 2 Nov 2004 12:48:57 -0000 1.53 +++ Keyboard.java 11 Nov 2004 16:03:12 -0000 1.54 @@ -197,6 +197,8 @@ public static final int STATE_OFF = 1; public static final int STATE_UNKNOWN = 2; + public final static int KEYBOARD_SIZE = 256; + /** Buffer size in events */ private final static int BUFFER_SIZE = 50; /** Event size in elements */ @@ -237,7 +239,7 @@ private static boolean created; /** The keys status from the last poll */ - private static final ByteBuffer keyDownBuffer = BufferUtils.createByteBuffer(256); + private static final ByteBuffer keyDownBuffer = BufferUtils.createByteBuffer(KEYBOARD_SIZE); /** * The key events from the last read: a sequence of pairs of key number, |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:03:53
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339 Modified Files: build.xml Log Message: Mac OS X port, second try :) Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- build.xml 5 Nov 2004 17:19:02 -0000 1.40 +++ build.xml 11 Nov 2004 16:03:10 -0000 1.41 @@ -332,6 +332,9 @@ <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/win32" force="yes"> <class name="org.lwjgl.opengl.Win32Display" /> </javah> + <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes"> + <class name="org.lwjgl.opengl.MacOSXDisplay" /> + </javah> <!-- lwjgl --> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes"> <class name="org.lwjgl.Sys" /> |
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/native/macosx Added Files: Makefile org_lwjgl_Sys.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_Pbuffer.c Removed Files: Makefile.am Window.h hid.cpp hid.h org_lwjgl_Display.cpp org_lwjgl_input_Controller.cpp org_lwjgl_input_Cursor.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Pbuffer.cpp org_lwjgl_opengl_Window.cpp tools.cpp tools.h Log Message: Mac OS X port, second try :) --- tools.h DELETED --- --- tools.cpp DELETED --- --- org_lwjgl_Display.cpp DELETED --- --- org_lwjgl_opengl_Pbuffer.cpp DELETED --- --- NEW FILE: Makefile --- AL=/Users/oddlabs/cvs/openal CC=gcc LINKER=gcc STRIP=strip CFLAGS_LINK=-dynamiclib -Wall #FRAMEWORKS=-framework OpenGL -framework AppKit -framework JavaVM FRAMEWORKS=-framework Foundation -framework AppKit -framework JavaVM CFLAGS_O=-O2 -D_MACOSX -Wall -c -I${AL}/include -I../common -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers #SRC:=$(shell find . -name \*.c -print) $(shell find ../common -name \*.c) SRC=$(wildcard *.m) $(wildcard *.c) $(wildcard ../common/*.c) $(wildcard ../common/arb/*.c) $(wildcard ../common/ati/*.c) $(wildcard ../common/ext/*.c) $(wildcard ../common/nv/*.c) OBJECTS=$(subst .m,.o, $(subst .c,.o,$(SRC))) #OBJECTS=org_lwjgl_opengl_Display.o \ # org_lwjgl_Sys.o \ # ../common/extgl.o \ # ../common/extal.o \ # ../common/org_lwjgl_openal_AL.o \ # ../common/org_lwjgl_openal_ALC.o \ # ../common/org_lwjgl_openal_AL10.o \ # ../common/common_tools.o LIBRARY=liblwjgl.jnilib $(LIBRARY): $(OBJECTS) $(LINKER) $(CFLAGS_LINK) -o $@ $(OBJECTS) $(FRAMEWORKS) # $(STRIP) -S -X $@ .m.o: $(CC) $(CFLAGS_O) $< -o $@ .c.o: $(CC) $(CFLAGS_O) $< -o $@ clean: rm -f ${OBJECTS} ${LIBRARY} --- org_lwjgl_opengl_Window.cpp DELETED --- --- hid.h DELETED --- --- org_lwjgl_input_Keyboard.cpp DELETED --- --- NEW FILE: org_lwjgl_input_Mouse.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_input_Mouse.c,v 1.1 2004/11/11 16:03:17 elias_naur Exp $ * * Mac OS X mouse handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <jni.h> #include <ApplicationServices/ApplicationServices.h> #include "common_tools.h" JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nGrabMouse(JNIEnv *env, jobject this, jboolean grab) { CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE); if (grab == JNI_TRUE) CGDisplayHideCursor(kCGDirectMainDisplay); else CGDisplayShowCursor(kCGDirectMainDisplay); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_nWarpCursor(JNIEnv *env, jobject this, jint x, jint y) { CGPoint p; p.x = x; p.y = y; CGWarpMouseCursorPosition(p); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_getMouseDeltas(JNIEnv *env, jobject this, jobject delta_buffer) { CGMouseDelta dx, dy; CGGetLastMouseDelta(&dx, &dy); int buffer_length = (*env)->GetDirectBufferCapacity(env, delta_buffer); if (buffer_length != 2) { printfDebug("Delta buffer not large enough!\n"); return; } jint *buffer = (*env)->GetDirectBufferAddress(env, delta_buffer); buffer[0] = dx; buffer[1] = dy; } --- NEW FILE: org_lwjgl_Sys.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_Sys.c,v 1.1 2004/11/11 16:03:17 elias_naur Exp $ * * Linux system library. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <sched.h> #include <sys/time.h> #include <sys/resource.h> #include <Carbon/Carbon.h> #include "org_lwjgl_Sys.h" #include "common_tools.h" static long int hires_timer; // Hires timer current time /* * Class: org_lwjgl_Sys * Method: getTimerResolution * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTimerResolution (JNIEnv * env, jclass clazz) { // Constant on MacOS return 1000000; } static long queryTime(void) { struct timeval tv; if (gettimeofday(&tv, NULL) == -1) { printfDebug("Could not read current time\n"); } long result = tv.tv_sec * 1000000l + tv.tv_usec; return result; } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setDebug(JNIEnv *env, jclass clazz, jboolean enabled) { setDebugEnabled(enabled == JNI_TRUE ? true : false); } JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_ngetTime (JNIEnv * env, jclass clazz) { hires_timer = queryTime(); return (jlong) hires_timer; } JNIEXPORT jstring JNICALL Java_org_lwjgl_Sys_getNativeLibraryVersion(JNIEnv *env, jclass clazz) { return getVersionString(env); } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority(JNIEnv * env, jclass clazz, jint priority) { printfDebug("WARNING: setProcessPriority unsupported\n"); } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nAlert(JNIEnv * env, jclass clazz, jstring title, jstring message) { } JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv * env, jclass clazz, jstring url) { /* const char * urlString = env->GetStringUTFChars(url, NULL); OSStatus err; ICInstance inst; long startSel; long endSel; Str255 urlStr; CopyCStringToPascal(urlString, urlStr); env->ReleaseStringUTFChars(url, urlString); err = ICStart(&inst, '????'); // Use your creator code if you have one! if (err == noErr) { startSel = 0; endSel = urlStr[0]; err = ICLaunchURL(inst, "\p", (char *) &urlStr[1], urlStr[0], &startSel, &endSel); (void) ICStop(inst); }*/ } JNIEXPORT jstring JNICALL Java_org_lwjgl_Sys_nGetClipboard (JNIEnv * env, jclass clazz) { return NULL; } --- Makefile.am DELETED --- --- org_lwjgl_input_Controller.cpp DELETED --- --- hid.cpp DELETED --- --- Window.h DELETED --- --- org_lwjgl_input_Mouse.cpp DELETED --- --- NEW FILE: org_lwjgl_opengl_Pbuffer.c --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_Pbuffer.c,v 1.1 2004/11/11 16:03:18 elias_naur Exp $ * * Mac OS X Pbuffer. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <jni.h> JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps(JNIEnv *env, jclass clazz) { return 0; } --- org_lwjgl_input_Cursor.cpp DELETED --- |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:03:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx/altivec In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/native/macosx/altivec Removed Files: org_lwjgl_Math_MatrixOpCopy_MatrixOpSafe.cpp Log Message: Mac OS X port, second try :) --- org_lwjgl_Math_MatrixOpCopy_MatrixOpSafe.cpp DELETED --- |
|
From: Elias N. <eli...@us...> - 2004-11-11 16:03:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/java/org/lwjgl/opengl Added Files: KeyboardEventQueue.java MacOSXDisplay.java MacOSXGLCanvas.java Log Message: Mac OS X port, second try :) --- NEW FILE: MacOSXDisplay.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; /** * This is the Display implementation interface. Display delegates * to implementors of this interface. There is one DisplayImplementation * for each supported platform. * @author elias_naur */ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.ByteBuffer; import org.lwjgl.LWJGLException; import org.lwjgl.Sys; import org.lwjgl.input.Mouse; import java.util.List; import java.util.ArrayList; import java.awt.BorderLayout; import java.awt.Frame; import javax.swing.JFrame; import java.awt.Insets; import java.awt.Cursor; import java.awt.Rectangle; import java.awt.Dimension; import java.awt.Point; import java.awt.Toolkit; import java.awt.GraphicsEnvironment; import java.awt.GraphicsDevice; import java.awt.image.BufferedImage; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import com.apple.eawt.Application; import com.apple.eawt.ApplicationListener; import com.apple.eawt.ApplicationEvent; final class MacOSXDisplay extends WindowAdapter implements DisplayImplementation, ApplicationListener { private JFrame frame; private MacOSXGLCanvas canvas; private boolean close_requested; private MouseEventQueue mouse_queue; private KeyboardEventQueue keyboard_queue; private java.awt.DisplayMode requested_mode; public MacOSXDisplay() { Application.getApplication().addApplicationListener(this); System.out.println("getMaxCursorSize = " + getMaxCursorSize()); } public void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException { close_requested = false; frame = new JFrame(); frame.setResizable(false); frame.addWindowListener(this); canvas = new MacOSXGLCanvas(); frame.getContentPane().add(canvas, BorderLayout.CENTER); frame.setUndecorated(fullscreen); if (fullscreen) { getDevice().setFullScreenWindow(frame); getDevice().setDisplayMode(requested_mode); /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */ if (requested_mode.getWidth() != getDevice().getDisplayMode().getWidth() || requested_mode.getHeight() != getDevice().getDisplayMode().getHeight()) { destroyWindow(); throw new LWJGLException("AWT capped mode"); } } frame.pack(); reshape(x, y, mode.getWidth(), mode.getHeight()); frame.setVisible(true); frame.requestFocus(); canvas.requestFocus(); canvas.waitForCanvasCreated(); } private GraphicsDevice getDevice() { GraphicsEnvironment g_env = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice device = g_env.getDefaultScreenDevice(); return device; } public void handleAbout(ApplicationEvent event) { } public void handleOpenApplication(ApplicationEvent event) { } public void handleOpenFile(ApplicationEvent event) { } public void handlePreferences(ApplicationEvent event) { } public void handlePrintFile(ApplicationEvent event) { } public void handleQuit(ApplicationEvent event) { handleQuit(); } public void handleReOpenApplication(ApplicationEvent event) { } private void handleQuit() { synchronized (this) { close_requested = true; } } public void windowClosing(WindowEvent e) { handleQuit(); } public void windowActivated(WindowEvent e) { warpCursor(); } public void destroyWindow() { if (getDevice().getFullScreenWindow() != null) getDevice().setFullScreenWindow(null); setView(null); frame.dispose(); frame = null; canvas = null; } public native int getGammaRampLength(); public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException; public String getAdapter() { return null; } public String getVersion() { return null; } private boolean equals(java.awt.DisplayMode awt_mode, DisplayMode mode) { return awt_mode.getWidth() == mode.getWidth() && awt_mode.getHeight() == mode.getHeight() && awt_mode.getBitDepth() == mode.getBitsPerPixel() && awt_mode.getRefreshRate() == mode.getFrequency(); } public void switchDisplayMode(DisplayMode mode) throws LWJGLException { java.awt.DisplayMode[] awt_modes = getDevice().getDisplayModes(); for (int i = 0; i < awt_modes.length; i++) if (equals(awt_modes[i], mode)) { requested_mode = awt_modes[i]; return; } throw new LWJGLException(mode + " is not supported"); } public void resetDisplayMode() { if (getDevice().getFullScreenWindow() != null) getDevice().setFullScreenWindow(null); requested_mode = null; } private DisplayMode createLWJGLDisplayMode(java.awt.DisplayMode awt_mode) { int bit_depth; int refresh_rate; int awt_bit_depth = awt_mode.getBitDepth(); int awt_refresh_rate = awt_mode.getRefreshRate(); if (awt_bit_depth != java.awt.DisplayMode.BIT_DEPTH_MULTI) bit_depth = awt_bit_depth; else bit_depth = 32; // Assume the best bit depth if (awt_refresh_rate != java.awt.DisplayMode.REFRESH_RATE_UNKNOWN) refresh_rate = awt_refresh_rate; else refresh_rate = 0; return new DisplayMode(awt_mode.getWidth(), awt_mode.getHeight(), bit_depth, refresh_rate); } public DisplayMode init() { return createLWJGLDisplayMode(getDevice().getDisplayMode()); } public DisplayMode[] getAvailableDisplayModes() { java.awt.DisplayMode[] awt_modes = getDevice().getDisplayModes(); List modes = new ArrayList(); for (int i = 0; i < awt_modes.length; i++) if (awt_modes[i].getBitDepth() >= 16) modes.add(createLWJGLDisplayMode(awt_modes[i])); DisplayMode[] mode_list = new DisplayMode[modes.size()]; modes.toArray(mode_list); return mode_list; } public void setTitle(String title) { frame.setTitle(title); } public boolean isCloseRequested() { boolean result; synchronized (this) { result = close_requested; close_requested = false; } return result; } public boolean isVisible() { return frame.isShowing(); } public boolean isActive() { return frame.isFocused(); } public boolean isDirty() { return canvas.isDirty(); } public native void setView(MacOSXGLCanvas canvas); public native void swapBuffers(); public native void makeCurrent() throws LWJGLException; public native void createContext(PixelFormat pixel_format) throws LWJGLException; public native void destroyContext(); public void update() { if (canvas.shouldUpdateContext()) { updateContext(); /* This is necessary to make sure the context won't "forget" about the view size */ GL11.glViewport(0, 0, canvas.getWidth(), canvas.getHeight()); warpCursor(); } mouse_queue.updateDeltas(); } private void warpCursor() { if (mouse_queue != null && mouse_queue.isGrabbed()) { Rectangle bounds = frame.getBounds(); int x = bounds.x + bounds.width/2; int y = bounds.y + bounds.height/2; nWarpCursor(x, y); } } native void getMouseDeltas(IntBuffer delta_buffer); private native void updateContext(); public native void setVSyncEnabled(boolean sync); public void reshape(int x, int y, int width, int height) { Insets insets = frame.getInsets(); frame.setBounds(x, y, width + insets.left + insets.right, height + insets.top + insets.bottom); } /* Mouse */ public boolean hasWheel() { return true; } public int getButtonCount() { return MouseEventQueue.NUM_BUTTONS; } public void createMouse() { this.mouse_queue = new MouseEventQueue(canvas.getWidth(), canvas.getHeight()); canvas.addMouseListener(mouse_queue); canvas.addMouseMotionListener(mouse_queue); canvas.addMouseWheelListener(mouse_queue); } public void destroyMouse() { canvas.removeMouseListener(mouse_queue); canvas.removeMouseWheelListener(mouse_queue); canvas.removeMouseMotionListener(mouse_queue); this.mouse_queue = null; } public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons_buffer) { mouse_queue.poll(coord_buffer, buttons_buffer); } public void enableMouseBuffer() throws LWJGLException { } public int readMouse(IntBuffer buffer, int buffer_position) { assert buffer_position == buffer.position(); return mouse_queue.copyEvents(buffer); } public void grabMouse(boolean grab) { nGrabMouse(grab); mouse_queue.setGrabbed(grab); warpCursor(); } private native void nWarpCursor(int x, int y); private native void nGrabMouse(boolean grab); public int getNativeCursorCaps() { int cursor_colors = Toolkit.getDefaultToolkit().getMaximumCursorColors(); boolean supported = cursor_colors >= Short.MAX_VALUE && getMaxCursorSize() > 0; int caps = supported ? Mouse.CURSOR_8_BIT_ALPHA | Mouse.CURSOR_ONE_BIT_TRANSPARENCY: 0; return caps; } public void setNativeCursor(Object handle) throws LWJGLException { Cursor awt_cursor = (Cursor)handle; canvas.setCursor(awt_cursor); } public int getMinCursorSize() { Dimension min_size = Toolkit.getDefaultToolkit().getBestCursorSize(0, 0); return Math.max(min_size.width, min_size.height); } public int getMaxCursorSize() { Dimension max_size = Toolkit.getDefaultToolkit().getBestCursorSize(10000, 10000); return Math.min(max_size.width, max_size.height); } /* Keyboard */ public void createKeyboard() throws LWJGLException { this.keyboard_queue = new KeyboardEventQueue(); canvas.addKeyListener(keyboard_queue); } public void destroyKeyboard() { /* * This line is commented out to work around AWT bug 4867453: * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4867453 */ // canvas.removeKeyListener(keyboard_queue); this.keyboard_queue = null; } public void pollKeyboard(ByteBuffer keyDownBuffer) { keyboard_queue.poll(keyDownBuffer); } public int readKeyboard(IntBuffer buffer, int buffer_position) { assert buffer_position == buffer.position(); return keyboard_queue.copyEvents(buffer); } public void enableTranslation() throws LWJGLException { } public void enableKeyboardBuffer() throws LWJGLException { } public native int isStateKeySet(int key); /** Native cursor handles */ public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { BufferedImage cursor_image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); int[] pixels = new int[images.remaining()]; int old_position = images.position(); images.get(pixels); images.position(old_position); cursor_image.setRGB(0, 0, width, height, pixels, 0, width); return Toolkit.getDefaultToolkit().createCustomCursor(cursor_image, new Point(xHotspot, yHotspot), "LWJGL Custom cursor"); } public void destroyCursor(Object cursor_handle) { } } --- NEW FILE: MacOSXGLCanvas.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; /** * The AWT compatible Canvas for Mac OS X. * @author elias_naur */ import java.awt.Canvas; import java.awt.Dimension; import java.awt.Point; import java.awt.Graphics; import java.awt.event.HierarchyBoundsListener; import java.awt.event.HierarchyEvent; final class MacOSXGLCanvas extends Canvas implements HierarchyBoundsListener { private boolean context_update; private boolean canvas_created; private boolean dirty; public MacOSXGLCanvas() { setFocusTraversalKeysEnabled(false); /* Input methods are not enabled in fullscreen anyway, so disable always */ enableInputMethods(false); addHierarchyBoundsListener(this); } public void update(Graphics g) { paint(g); } public void paint(Graphics g) { synchronized (this) { dirty = true; if (!canvas_created) { ((MacOSXDisplay)Display.getImplementation()).setView(this); canvas_created = true; setUpdate(); notify(); } } } public boolean isDirty() { boolean result; synchronized (this) { result = dirty; dirty = false; } return result; } public void waitForCanvasCreated() { synchronized (this) { while (!canvas_created) { try { wait(); } catch (InterruptedException e) { // ignore } } } } public boolean shouldUpdateContext() { boolean should_update; synchronized (this) { should_update = context_update; context_update = false; } return should_update; } private synchronized void setUpdate() { context_update = true; } public void ancestorResized(HierarchyEvent e) { setUpdate(); } public void ancestorMoved(HierarchyEvent e) { setUpdate(); } public void setLocation(int x, int y) { super.setLocation(x, y); setUpdate(); } public void setLocation(Point p) { super.setLocation(p); setUpdate(); } public void setSize(Dimension d) { super.setSize(d); setUpdate(); } public void setSize(int width, int height) { super.setSize(width, height); setUpdate(); } public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); setUpdate(); } } --- NEW FILE: KeyboardEventQueue.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; /** * A java implementation of a LWJGL compatible Keyboard event queue. * Currently only used by the Mac OS X implementation. * @author elias_naur */ import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.awt.event.KeyListener; import java.awt.event.KeyEvent; import org.lwjgl.input.Keyboard; final class KeyboardEventQueue extends EventQueue implements KeyListener { private final static int[] KEY_MAP = new int[0xffff]; private final static int EVENT_SIZE = 3; private final byte[] key_states = new byte[Keyboard.KEYBOARD_SIZE]; /** Event scratch array */ private final int[] event = new int[EVENT_SIZE]; static { KEY_MAP[KeyEvent.VK_0] = Keyboard.KEY_0; KEY_MAP[KeyEvent.VK_1] = Keyboard.KEY_1; KEY_MAP[KeyEvent.VK_2] = Keyboard.KEY_2; KEY_MAP[KeyEvent.VK_3] = Keyboard.KEY_3; KEY_MAP[KeyEvent.VK_4] = Keyboard.KEY_4; KEY_MAP[KeyEvent.VK_5] = Keyboard.KEY_5; KEY_MAP[KeyEvent.VK_6] = Keyboard.KEY_6; KEY_MAP[KeyEvent.VK_7] = Keyboard.KEY_7; KEY_MAP[KeyEvent.VK_8] = Keyboard.KEY_8; KEY_MAP[KeyEvent.VK_9] = Keyboard.KEY_9; KEY_MAP[KeyEvent.VK_A] = Keyboard.KEY_A; // KEY_MAP[KeyEvent.VK_ACCEPT] = Keyboard.KEY_ACCEPT; KEY_MAP[KeyEvent.VK_ADD] = Keyboard.KEY_ADD; // KEY_MAP[KeyEvent.VK_AGAIN] = Keyboard.KEY_AGAIN; // KEY_MAP[KeyEvent.VK_ALL_CANDIDATES] = Keyboard.KEY_ALL_CANDIDATES; // KEY_MAP[KeyEvent.VK_ALPHANUMERIC] = Keyboard.KEY_ALPHANUMERIC; KEY_MAP[KeyEvent.VK_ALT] = Keyboard.KEY_LMENU; KEY_MAP[KeyEvent.VK_ALT_GRAPH] = Keyboard.KEY_RMENU; // KEY_MAP[KeyEvent.VK_AMPERSAND] = Keyboard.KEY_AMPERSAND; // KEY_MAP[KeyEvent.VK_ASTERISK] = Keyboard.KEY_ASTERISK; KEY_MAP[KeyEvent.VK_AT] = Keyboard.KEY_AT; KEY_MAP[KeyEvent.VK_B] = Keyboard.KEY_B; // KEY_MAP[KeyEvent.VK_BACK_QUOTE] = Keyboard.KEY_BACK_QUOTE; KEY_MAP[KeyEvent.VK_BACK_SLASH] = Keyboard.KEY_BACKSLASH; KEY_MAP[KeyEvent.VK_BACK_SPACE] = Keyboard.KEY_BACK; // KEY_MAP[KeyEvent.VK_BRACELEFT] = Keyboard.KEY_BRACELEFT; // KEY_MAP[KeyEvent.VK_BRACERIGHT] = Keyboard.KEY_BRACERIGHT; KEY_MAP[KeyEvent.VK_C] = Keyboard.KEY_C; // KEY_MAP[KeyEvent.VK_CANCEL] = Keyboard.KEY_CANCEL; KEY_MAP[KeyEvent.VK_CAPS_LOCK] = Keyboard.KEY_CAPITAL; KEY_MAP[KeyEvent.VK_CIRCUMFLEX] = Keyboard.KEY_CIRCUMFLEX; // KEY_MAP[KeyEvent.VK_CLEAR] = Keyboard.KEY_CLEAR; KEY_MAP[KeyEvent.VK_CLOSE_BRACKET] = Keyboard.KEY_RBRACKET; // KEY_MAP[KeyEvent.VK_CODE_INPUT] = Keyboard.KEY_CODE_INPUT; KEY_MAP[KeyEvent.VK_COLON] = Keyboard.KEY_COLON; KEY_MAP[KeyEvent.VK_COMMA] = Keyboard.KEY_COMMA; // KEY_MAP[KeyEvent.VK_COMPOSE] = Keyboard.KEY_COMPOSE; KEY_MAP[KeyEvent.VK_CONTROL] = Keyboard.KEY_LCONTROL; KEY_MAP[KeyEvent.VK_CONVERT] = Keyboard.KEY_CONVERT; // KEY_MAP[KeyEvent.VK_COPY] = Keyboard.KEY_COPY; // KEY_MAP[KeyEvent.VK_CUT] = Keyboard.KEY_CUT; KEY_MAP[KeyEvent.VK_D] = Keyboard.KEY_D; // KEY_MAP[KeyEvent.VK_DEAD_ABOVEDOT] = Keyboard.KEY_DEAD_ABOVEDOT; // KEY_MAP[KeyEvent.VK_DEAD_ABOVERING] = Keyboard.KEY_DEAD_ABOVERING; // KEY_MAP[KeyEvent.VK_DEAD_ACUTE] = Keyboard.KEY_DEAD_ACUTE; // KEY_MAP[KeyEvent.VK_DEAD_BREVE] = Keyboard.KEY_DEAD_BREVE; // KEY_MAP[KeyEvent.VK_DEAD_CARON] = Keyboard.KEY_DEAD_CARON; // KEY_MAP[KeyEvent.VK_DEAD_CEDILLA] = Keyboard.KEY_DEAD_CEDILLA; // KEY_MAP[KeyEvent.VK_DEAD_CIRCUMFLEX] = Keyboard.KEY_DEAD_CIRCUMFLEX; // KEY_MAP[KeyEvent.VK_DEAD_DIAERESIS] = Keyboard.KEY_DEAD_DIAERESIS; // KEY_MAP[KeyEvent.VK_DEAD_DOUBLEACUTE] = Keyboard.KEY_DEAD_DOUBLEACUTE; // KEY_MAP[KeyEvent.VK_DEAD_GRAVE] = Keyboard.KEY_DEAD_GRAVE; // KEY_MAP[KeyEvent.VK_DEAD_IOTA] = Keyboard.KEY_DEAD_IOTA; // KEY_MAP[KeyEvent.VK_DEAD_MACRON] = Keyboard.KEY_DEAD_MACRON; // KEY_MAP[KeyEvent.VK_DEAD_OGONEK] = Keyboard.KEY_DEAD_OGONEK; // KEY_MAP[KeyEvent.VK_DEAD_SEMIVOICED_SOUND] = Keyboard.KEY_DEAD_SEMIVOICED_SOUND; // KEY_MAP[KeyEvent.VK_DEAD_TILDE] = Keyboard.KEY_DEAD_TILDE; // KEY_MAP[KeyEvent.VK_DEAD_VOICED_SOUND] = Keyboard.KEY_DEAD_VOICED_SOUND; KEY_MAP[KeyEvent.VK_DECIMAL] = Keyboard.KEY_DECIMAL; KEY_MAP[KeyEvent.VK_DELETE] = Keyboard.KEY_DELETE; KEY_MAP[KeyEvent.VK_DIVIDE] = Keyboard.KEY_DIVIDE; // KEY_MAP[KeyEvent.VK_DOLLAR] = Keyboard.KEY_DOLLAR; KEY_MAP[KeyEvent.VK_DOWN] = Keyboard.KEY_DOWN; KEY_MAP[KeyEvent.VK_E] = Keyboard.KEY_E; KEY_MAP[KeyEvent.VK_END] = Keyboard.KEY_END; KEY_MAP[KeyEvent.VK_ENTER] = Keyboard.KEY_RETURN; KEY_MAP[KeyEvent.VK_EQUALS] = Keyboard.KEY_EQUALS; KEY_MAP[KeyEvent.VK_ESCAPE] = Keyboard.KEY_ESCAPE; // KEY_MAP[KeyEvent.VK_EURO_SIGN] = Keyboard.KEY_EURO_SIGN; // KEY_MAP[KeyEvent.VK_EXCLAMATION_MARK] = Keyboard.KEY_EXCLAMATION_MARK; KEY_MAP[KeyEvent.VK_F] = Keyboard.KEY_F; KEY_MAP[KeyEvent.VK_F1] = Keyboard.KEY_F1; KEY_MAP[KeyEvent.VK_F10] = Keyboard.KEY_F10; KEY_MAP[KeyEvent.VK_F11] = Keyboard.KEY_F11; KEY_MAP[KeyEvent.VK_F12] = Keyboard.KEY_F12; KEY_MAP[KeyEvent.VK_F13] = Keyboard.KEY_F13; KEY_MAP[KeyEvent.VK_F14] = Keyboard.KEY_F14; KEY_MAP[KeyEvent.VK_F15] = Keyboard.KEY_F15; // KEY_MAP[KeyEvent.VK_F16] = Keyboard.KEY_F16; // KEY_MAP[KeyEvent.VK_F17] = Keyboard.KEY_F17; // KEY_MAP[KeyEvent.VK_F18] = Keyboard.KEY_F18; // KEY_MAP[KeyEvent.VK_F19] = Keyboard.KEY_F19; KEY_MAP[KeyEvent.VK_F2] = Keyboard.KEY_F2; // KEY_MAP[KeyEvent.VK_F20] = Keyboard.KEY_F20; // KEY_MAP[KeyEvent.VK_F21] = Keyboard.KEY_F21; // KEY_MAP[KeyEvent.VK_F22] = Keyboard.KEY_F22; // KEY_MAP[KeyEvent.VK_F23] = Keyboard.KEY_F23; // KEY_MAP[KeyEvent.VK_F24] = Keyboard.KEY_F24; KEY_MAP[KeyEvent.VK_F3] = Keyboard.KEY_F3; KEY_MAP[KeyEvent.VK_F4] = Keyboard.KEY_F4; KEY_MAP[KeyEvent.VK_F5] = Keyboard.KEY_F5; KEY_MAP[KeyEvent.VK_F6] = Keyboard.KEY_F6; KEY_MAP[KeyEvent.VK_F7] = Keyboard.KEY_F7; KEY_MAP[KeyEvent.VK_F8] = Keyboard.KEY_F8; KEY_MAP[KeyEvent.VK_F9] = Keyboard.KEY_F9; // KEY_MAP[KeyEvent.VK_FINAL] = Keyboard.KEY_FINAL; // KEY_MAP[KeyEvent.VK_FIND] = Keyboard.KEY_FIND; // KEY_MAP[KeyEvent.VK_FULL_WIDTH] = Keyboard.KEY_FULL_WIDTH; KEY_MAP[KeyEvent.VK_G] = Keyboard.KEY_G; // KEY_MAP[KeyEvent.VK_GREATER] = Keyboard.KEY_GREATER; KEY_MAP[KeyEvent.VK_H] = Keyboard.KEY_H; // KEY_MAP[KeyEvent.VK_HALF_WIDTH] = Keyboard.KEY_HALF_WIDTH; // KEY_MAP[KeyEvent.VK_HELP] = Keyboard.KEY_HELP; // KEY_MAP[KeyEvent.VK_HIRAGANA] = Keyboard.KEY_HIRAGANA; KEY_MAP[KeyEvent.VK_HOME] = Keyboard.KEY_HOME; KEY_MAP[KeyEvent.VK_I] = Keyboard.KEY_I; // KEY_MAP[KeyEvent.VK_INPUT_METHOD_ON_OFF] = Keyboard.KEY_INPUT_METHOD_ON_OFF; KEY_MAP[KeyEvent.VK_INSERT] = Keyboard.KEY_INSERT; // KEY_MAP[KeyEvent.VK_INVERTED_EXCLAMATION_MARK] = Keyboard.KEY_INVERTED_EXCLAMATION_MARK; KEY_MAP[KeyEvent.VK_J] = Keyboard.KEY_J; // KEY_MAP[KeyEvent.VK_JAPANESE_HIRAGANA] = Keyboard.KEY_JAPANESE_HIRAGANA; // KEY_MAP[KeyEvent.VK_JAPANESE_KATAKANA] = Keyboard.KEY_JAPANESE_KATAKANA; // KEY_MAP[KeyEvent.VK_JAPANESE_ROMAN] = Keyboard.KEY_JAPANESE_ROMAN; KEY_MAP[KeyEvent.VK_K] = Keyboard.KEY_K; KEY_MAP[KeyEvent.VK_KANA] = Keyboard.KEY_KANA; // KEY_MAP[KeyEvent.VK_KANA_LOCK] = Keyboard.KEY_KANA_LOCK; KEY_MAP[KeyEvent.VK_KANJI] = Keyboard.KEY_KANJI; // KEY_MAP[KeyEvent.VK_KATAKANA] = Keyboard.KEY_KATAKANA; // KEY_MAP[KeyEvent.VK_KP_DOWN] = Keyboard.KEY_KP_DOWN; // KEY_MAP[KeyEvent.VK_KP_LEFT] = Keyboard.KEY_KP_LEFT; // KEY_MAP[KeyEvent.VK_KP_RIGHT] = Keyboard.KEY_KP_RIGHT; // KEY_MAP[KeyEvent.VK_KP_UP] = Keyboard.KEY_KP_UP; KEY_MAP[KeyEvent.VK_L] = Keyboard.KEY_L; KEY_MAP[KeyEvent.VK_LEFT] = Keyboard.KEY_LEFT; // KEY_MAP[KeyEvent.VK_LEFT_PARENTHESIS] = Keyboard.KEY_LEFT_PARENTHESIS; // KEY_MAP[KeyEvent.VK_LESS] = Keyboard.KEY_LESS; KEY_MAP[KeyEvent.VK_M] = Keyboard.KEY_M; // KEY_MAP[KeyEvent.VK_META] = Keyboard.KEY_META; KEY_MAP[KeyEvent.VK_MINUS] = Keyboard.KEY_MINUS; // KEY_MAP[KeyEvent.VK_MODECHANGE] = Keyboard.KEY_MODECHANGE; KEY_MAP[KeyEvent.VK_MULTIPLY] = Keyboard.KEY_MULTIPLY; KEY_MAP[KeyEvent.VK_N] = Keyboard.KEY_N; // KEY_MAP[KeyEvent.VK_NONCONVERT] = Keyboard.KEY_NONCONVERT; KEY_MAP[KeyEvent.VK_NUM_LOCK] = Keyboard.KEY_NUMLOCK; // KEY_MAP[KeyEvent.VK_NUMBER_SIGN] = Keyboard.KEY_NUMBER_SIGN; KEY_MAP[KeyEvent.VK_NUMPAD0] = Keyboard.KEY_NUMPAD0; KEY_MAP[KeyEvent.VK_NUMPAD1] = Keyboard.KEY_NUMPAD1; KEY_MAP[KeyEvent.VK_NUMPAD2] = Keyboard.KEY_NUMPAD2; KEY_MAP[KeyEvent.VK_NUMPAD3] = Keyboard.KEY_NUMPAD3; KEY_MAP[KeyEvent.VK_NUMPAD4] = Keyboard.KEY_NUMPAD4; KEY_MAP[KeyEvent.VK_NUMPAD5] = Keyboard.KEY_NUMPAD5; KEY_MAP[KeyEvent.VK_NUMPAD6] = Keyboard.KEY_NUMPAD6; KEY_MAP[KeyEvent.VK_NUMPAD7] = Keyboard.KEY_NUMPAD7; KEY_MAP[KeyEvent.VK_NUMPAD8] = Keyboard.KEY_NUMPAD8; KEY_MAP[KeyEvent.VK_NUMPAD9] = Keyboard.KEY_NUMPAD9; KEY_MAP[KeyEvent.VK_O] = Keyboard.KEY_O; KEY_MAP[KeyEvent.VK_OPEN_BRACKET] = Keyboard.KEY_LBRACKET; KEY_MAP[KeyEvent.VK_P] = Keyboard.KEY_P; KEY_MAP[KeyEvent.VK_PAGE_DOWN] = Keyboard.KEY_NEXT; KEY_MAP[KeyEvent.VK_PAGE_UP] = Keyboard.KEY_PRIOR; // KEY_MAP[KeyEvent.VK_PASTE] = Keyboard.KEY_PASTE; KEY_MAP[KeyEvent.VK_PAUSE] = Keyboard.KEY_PAUSE; KEY_MAP[KeyEvent.VK_PERIOD] = Keyboard.KEY_PERIOD; // KEY_MAP[KeyEvent.VK_PLUS] = Keyboard.KEY_PLUS; // KEY_MAP[KeyEvent.VK_PREVIOUS_CANDIDATE] = Keyboard.KEY_PREVIOUS_CANDIDATE; // KEY_MAP[KeyEvent.VK_PRINTSCREEN] = Keyboard.KEY_PRINTSCREEN; // KEY_MAP[KeyEvent.VK_PROPS] = Keyboard.KEY_PROPS; KEY_MAP[KeyEvent.VK_Q] = Keyboard.KEY_Q; // KEY_MAP[KeyEvent.VK_QUOTE] = Keyboard.KEY_QUOTE; // KEY_MAP[KeyEvent.VK_QUOTEDBL] = Keyboard.KEY_QUOTEDBL; KEY_MAP[KeyEvent.VK_R] = Keyboard.KEY_R; KEY_MAP[KeyEvent.VK_RIGHT] = Keyboard.KEY_RIGHT; // KEY_MAP[KeyEvent.VK_RIGHT_PARENTHESIS] = Keyboard.KEY_RIGHT_PARENTHESIS; // KEY_MAP[KeyEvent.VK_ROMAN_CHARACTERS] = Keyboard.KEY_ROMAN_CHARACTERS; KEY_MAP[KeyEvent.VK_S] = Keyboard.KEY_S; KEY_MAP[KeyEvent.VK_SCROLL_LOCK] = Keyboard.KEY_SCROLL; KEY_MAP[KeyEvent.VK_SEMICOLON] = Keyboard.KEY_SEMICOLON; KEY_MAP[KeyEvent.VK_SEPARATOR] = Keyboard.KEY_DECIMAL; KEY_MAP[KeyEvent.VK_SHIFT] = Keyboard.KEY_LSHIFT; KEY_MAP[KeyEvent.VK_SLASH] = Keyboard.KEY_SLASH; KEY_MAP[KeyEvent.VK_SPACE] = Keyboard.KEY_SPACE; KEY_MAP[KeyEvent.VK_STOP] = Keyboard.KEY_STOP; KEY_MAP[KeyEvent.VK_SUBTRACT] = Keyboard.KEY_SUBTRACT; KEY_MAP[KeyEvent.VK_T] = Keyboard.KEY_T; KEY_MAP[KeyEvent.VK_TAB] = Keyboard.KEY_TAB; KEY_MAP[KeyEvent.VK_U] = Keyboard.KEY_U; // KEY_MAP[KeyEvent.VK_UNDERSCORE] = Keyboard.KEY_UNDERSCORE; // KEY_MAP[KeyEvent.VK_UNDO] = Keyboard.KEY_UNDO; KEY_MAP[KeyEvent.VK_UP] = Keyboard.KEY_UP; KEY_MAP[KeyEvent.VK_V] = Keyboard.KEY_V; KEY_MAP[KeyEvent.VK_W] = Keyboard.KEY_W; KEY_MAP[KeyEvent.VK_X] = Keyboard.KEY_X; KEY_MAP[KeyEvent.VK_Y] = Keyboard.KEY_Y; KEY_MAP[KeyEvent.VK_Z] = Keyboard.KEY_Z; } public KeyboardEventQueue() { super(EVENT_SIZE); } private void putKeyboardEvent(int key_code, int state, int character) { event[0] = key_code; event[1] = state; event[2] = character; putEvent(event); } public synchronized void poll(ByteBuffer key_down_buffer) { int old_position = key_down_buffer.position(); key_down_buffer.put(key_states); key_down_buffer.position(old_position); } private synchronized void handleKey(int key_code, int state, char character) { int key_code_mapped = KEY_MAP[key_code]; if (character == KeyEvent.CHAR_UNDEFINED) character = Keyboard.CHAR_NONE; int key_int_char = ((int)character) & 0xffff; putKeyboardEvent(key_code_mapped, state, key_int_char); } public void keyPressed(KeyEvent e) { handleKey(e.getKeyCode(), 1, e.getKeyChar()); } public void keyReleased(KeyEvent e) { handleKey(e.getKeyCode(), 0, Keyboard.CHAR_NONE); } public void keyTyped(KeyEvent e) { } } |
|
From: Elias N. <eli...@us...> - 2004-11-11 14:26:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20347 Modified Files: configure.in Log Message: Mac OS X automake not supported Index: configure.in =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/configure.in,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- configure.in 18 Sep 2004 11:41:30 -0000 1.58 +++ configure.in 11 Nov 2004 14:26:00 -0000 1.59 @@ -18,11 +18,6 @@ AC_CANONICAL_HOST case "$host_os" in - darwin*) _BUILD_FLAGS="-D_AGL -fpascal-strings" - LDFLAGS="-Xlinker -framework -Xlinker JavaVM -Xlinker -framework -Xlinker ApplicationServices -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker Carbon" - NATIVE_BUILD_DIR=macosx - CFLAGS="$CFLAGS -Wall $_BUILD_FLAGS" - ;; bsdi* | linux* | solaris*) AC_PATH_XTRA AC_LIBTOOL_DLOPEN _BUILD_FLAGS="-pthread -D_X11 $X_CFLAGS" @@ -74,6 +69,5 @@ common/ext/Makefile common/nv/Makefile common/fmod3/Makefile - linux/Makefile - macosx/Makefile]) + linux/Makefile]) AC_OUTPUT |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:54:35
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12769/input Modified Files: Cursor.java Log Message: Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Cursor.java 11 Nov 2004 13:27:57 -0000 1.30 +++ Cursor.java 11 Nov 2004 13:54:25 -0000 1.31 @@ -111,7 +111,7 @@ String osName = System.getProperty("os.name", ""); CursorElement[] cursors; - if (osName.startsWith("Win")) { + if (osName.startsWith("Win") || osName.startsWith("Mac")) { // create our cursor elements cursors = new CursorElement[numImages]; for(int i=0; i<numImages; i++) { |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:43:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8527/src/native/linux Modified Files: org_lwjgl_input_Cursor.c Log Message: Cursor fixup Index: org_lwjgl_input_Cursor.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Cursor.c 11 Nov 2004 13:27:58 -0000 1.2 +++ org_lwjgl_input_Cursor.c 11 Nov 2004 13:42:25 -0000 1.3 @@ -48,7 +48,7 @@ #include "common_tools.h" JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor - (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) + (JNIEnv *env, jobject this, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { if ((*env)->GetDirectBufferCapacity(env, handle_buffer) < sizeof(Cursor)) { throwException(env, "Handle buffer not large enough"); @@ -85,7 +85,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay__destroyCursor - (JNIEnv *env, jclass clazz, jobject cursor_handle_buffer) + (JNIEnv *env, jobject this, jobject cursor_handle_buffer) { Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle_buffer); // Cursor cursor = (Cursor)cursor_handle; |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:42:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8527/src/native/win32 Modified Files: org_lwjgl_input_Cursor.cpp Log Message: Cursor fixup Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_input_Cursor.cpp 11 Nov 2004 13:27:59 -0000 1.15 +++ org_lwjgl_input_Cursor.cpp 11 Nov 2004 13:42:26 -0000 1.16 @@ -45,7 +45,7 @@ #include "common_tools.h" JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_nCreateCursor - (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) + (JNIEnv *env, jobject self, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(HCURSOR)) { throwException(env, "Handle buffer not large enough"); @@ -146,7 +146,7 @@ * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_destroyCursor - (JNIEnv *env, jclass clazz, jobject handle_buffer) + (JNIEnv *env, jobject self, jobject handle_buffer) { // HCURSOR cursor = (HCURSOR)cursor_handle; HCURSOR *cursor_handle = (HCURSOR *)env->GetDirectBufferAddress(handle_buffer); |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:28:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/src/java/org/lwjgl/opengl Modified Files: DisplayImplementation.java LinuxDisplay.java Win32Display.java Log Message: Moved native cursors to DisplayImplementation Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Win32Display.java 2 Nov 2004 12:48:57 -0000 1.1 +++ Win32Display.java 11 Nov 2004 13:27:58 -0000 1.2 @@ -41,10 +41,14 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.ByteBuffer; +import java.nio.IntBuffer; import org.lwjgl.LWJGLException; +import org.lwjgl.BufferUtils; final class Win32Display implements DisplayImplementation { + private final static int CURSOR_HANDLE_SIZE = 8; + public native void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; public native void destroyWindow(); public native void switchDisplayMode(DisplayMode mode) throws LWJGLException; @@ -77,7 +81,7 @@ public native int readMouse(IntBuffer buffer, int buffer_position); public native void grabMouse(boolean grab); public native int getNativeCursorCaps(); - public native void setNativeCursor(ByteBuffer handle) throws LWJGLException; + public native void setNativeCursor(Object handle) throws LWJGLException; public native int getMinCursorSize(); public native int getMaxCursorSize(); /* Keyboard */ @@ -88,4 +92,14 @@ public native void enableTranslation() throws LWJGLException; public native void enableKeyboardBuffer() throws LWJGLException; public native int isStateKeySet(int key); + + public native void nCreateCursor(ByteBuffer handle, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; + + public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { + ByteBuffer handle = BufferUtils.createByteBuffer(CURSOR_HANDLE_SIZE); + nCreateCursor(handle, width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); + return handle; + } + + public native void destroyCursor(Object cursorHandle); } Index: DisplayImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DisplayImplementation.java 2 Nov 2004 12:48:57 -0000 1.1 +++ DisplayImplementation.java 11 Nov 2004 13:27:58 -0000 1.2 @@ -180,7 +180,7 @@ public int getNativeCursorCaps(); /** Native method to set the native cursor */ - public void setNativeCursor(ByteBuffer handle) throws LWJGLException; + public void setNativeCursor(Object handle) throws LWJGLException; /** Native method returning the minimum cursor size */ public int getMinCursorSize(); @@ -229,4 +229,9 @@ public void enableKeyboardBuffer() throws LWJGLException; public int isStateKeySet(int key); + + /** Native cursor handles */ + public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException; + + public void destroyCursor(Object cursor_handle); } Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LinuxDisplay.java 2 Nov 2004 12:48:57 -0000 1.1 +++ LinuxDisplay.java 11 Nov 2004 13:27:58 -0000 1.2 @@ -41,10 +41,14 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.ByteBuffer; +import java.nio.IntBuffer; import org.lwjgl.LWJGLException; +import org.lwjgl.BufferUtils; final class LinuxDisplay implements DisplayImplementation { + private final static int CURSOR_HANDLE_SIZE = 8; + public native void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; public native void destroyWindow(); public native void switchDisplayMode(DisplayMode mode) throws LWJGLException; @@ -77,7 +81,7 @@ public native int readMouse(IntBuffer buffer, int buffer_position); public native void grabMouse(boolean grab); public native int getNativeCursorCaps(); - public native void setNativeCursor(ByteBuffer handle) throws LWJGLException; + public native void setNativeCursor(Object handle) throws LWJGLException; public native int getMinCursorSize(); public native int getMaxCursorSize(); /* Keyboard */ @@ -88,4 +92,14 @@ public native void enableTranslation() throws LWJGLException; public native void enableKeyboardBuffer() throws LWJGLException; public native int isStateKeySet(int key); + + public native void nCreateCursor(ByteBuffer handle, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; + + public Object createCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { + ByteBuffer handle = BufferUtils.createByteBuffer(CURSOR_HANDLE_SIZE); + nCreateCursor(handle, width, height, xHotspot, yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : -1); + return handle; + } + + public native void destroyCursor(Object cursorHandle); } |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:28:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/src/java/org/lwjgl/input Modified Files: Cursor.java Log Message: Moved native cursors to DisplayImplementation Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Cursor.java 29 Jul 2004 11:20:43 -0000 1.29 +++ Cursor.java 11 Nov 2004 13:27:57 -0000 1.30 @@ -38,6 +38,7 @@ import org.lwjgl.BufferUtils; import org.lwjgl.BufferChecks; import org.lwjgl.Sys; +import org.lwjgl.opengl.Display; /** * $Id$ @@ -50,7 +51,6 @@ */ public class Cursor { - private final static int HANDLE_SIZE = 8; /** First element to display */ private final CursorElement[] cursors; @@ -115,8 +115,7 @@ // create our cursor elements cursors = new CursorElement[numImages]; for(int i=0; i<numImages; i++) { - ByteBuffer handle = BufferUtils.createByteBuffer(HANDLE_SIZE); - nCreateCursor(handle, width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); + Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, 1, images_copy, null); long delay = (delays != null) ? delays.get(i) : 0; long timeout = System.currentTimeMillis(); cursors[i] = new CursorElement(handle, delay, timeout); @@ -126,8 +125,7 @@ } } else if (osName.startsWith("Lin")) { // create our cursor elements - ByteBuffer handle = BufferUtils.createByteBuffer(HANDLE_SIZE); - nCreateCursor(handle, width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1); + Object handle = Display.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays); CursorElement cursor_element = new CursorElement(handle, -1, -1); cursors = new CursorElement[]{cursor_element}; } else { @@ -176,7 +174,7 @@ /** * Gets the native handle associated with the cursor object. */ - ByteBuffer getHandle() { + Object getHandle() { return cursors[index].cursorHandle; } @@ -194,7 +192,7 @@ } } for(int i=0; i<cursors.length; i++) { - nDestroyCursor(cursors[i].cursorHandle); + Display.getImplementation().destroyCursor(cursors[i].cursorHandle); } } @@ -221,21 +219,11 @@ } /** - * Native method to create a native cursor - */ - private static native void nCreateCursor(ByteBuffer handle, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; - - /** - * Native method to destroy a native cursor - */ - private static native void nDestroyCursor(ByteBuffer cursorHandle); - - /** * A single cursor element, used when animating */ private static class CursorElement { /** Handle to cursor */ - final ByteBuffer cursorHandle; + final Object cursorHandle; /** How long a delay this element should have */ final long delay; @@ -243,7 +231,7 @@ /** Absolute time this element times out */ long timeout; - CursorElement(ByteBuffer cursorHandle, long delay, long timeout) { + CursorElement(Object cursorHandle, long delay, long timeout) { this.cursorHandle = cursorHandle; this.delay = delay; this.timeout = timeout; |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:28:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/src/native/linux Modified Files: org_lwjgl_input_Cursor.c Log Message: Moved native cursors to DisplayImplementation Index: org_lwjgl_input_Cursor.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Cursor.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Cursor.c 10 Sep 2004 08:13:55 -0000 1.1 +++ org_lwjgl_input_Cursor.c 11 Nov 2004 13:27:58 -0000 1.2 @@ -43,11 +43,11 @@ #include <X11/Xlib.h> #include <X11/Xcursor/Xcursor.h> #include "org_lwjgl_input_Cursor.h" -//#include "extxcursor.h" +#include "org_lwjgl_opengl_LinuxDisplay.h" #include "Window.h" #include "common_tools.h" -JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateCursor (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { if ((*env)->GetDirectBufferCapacity(env, handle_buffer) < sizeof(Cursor)) { @@ -84,7 +84,7 @@ XcursorImagesDestroy(cursor_images); } -JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay__destroyCursor (JNIEnv *env, jclass clazz, jobject cursor_handle_buffer) { Cursor *cursor = (Cursor *)(*env)->GetDirectBufferAddress(env, cursor_handle_buffer); |
|
From: Elias N. <eli...@us...> - 2004-11-11 13:28:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4686/src/native/win32 Modified Files: org_lwjgl_input_Cursor.cpp Log Message: Moved native cursors to DisplayImplementation Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_input_Cursor.cpp 22 Sep 2004 15:06:27 -0000 1.14 +++ org_lwjgl_input_Cursor.cpp 11 Nov 2004 13:27:59 -0000 1.15 @@ -41,9 +41,10 @@ #include "Window.h" #include "org_lwjgl_input_Cursor.h" +#include "org_lwjgl_opengl_Win32Display.h" #include "common_tools.h" -JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_nCreateCursor (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(HCURSOR)) { @@ -144,7 +145,7 @@ * Method: nDestroyCursor * Signature: (I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_destroyCursor (JNIEnv *env, jclass clazz, jobject handle_buffer) { // HCURSOR cursor = (HCURSOR)cursor_handle; |