You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(2) |
2
(2) |
3
(2) |
4
|
5
(2) |
|
6
(5) |
7
(22) |
8
(4) |
9
(5) |
10
(6) |
11
(5) |
12
(7) |
|
13
(11) |
14
(1) |
15
(1) |
16
|
17
|
18
(3) |
19
(1) |
|
20
(10) |
21
(3) |
22
(7) |
23
|
24
(2) |
25
(2) |
26
(2) |
|
27
(1) |
28
(1) |
29
(4) |
30
(9) |
|
|
|
|
From: <eli...@us...> - 2008-04-30 19:00:15
|
Revision: 3059
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3059&view=rev
Author: elias_naur
Date: 2008-04-30 12:00:08 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Windows: Check for Display.isCreated in Sys.getHwnd()
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:40:14 UTC (rev 3058)
+++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 19:00:08 UTC (rev 3059)
@@ -65,6 +65,8 @@
private static native long nGetTime();
private static long getHwnd() {
+ if (!Display.isCreated())
+ return 0;
/* Use reflection since we can't make Display.getImplementation
* public
*/
@@ -74,8 +76,6 @@
Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
getImplementation_method.setAccessible(true);
Object display_impl = getImplementation_method.invoke(null, null);
- if (display_impl == null)
- return null;
Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay");
Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null);
getHwnd_method.setAccessible(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 16:40:22
|
Revision: 3058
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3058&view=rev
Author: elias_naur
Date: 2008-04-30 09:40:14 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Windows: Moved hwnd and hdc to java
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
trunk/LWJGL/src/native/windows/Window.h
trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:01:25 UTC (rev 3057)
+++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:40:14 UTC (rev 3058)
@@ -31,7 +31,13 @@
*/
package org.lwjgl;
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
+import java.security.AccessController;
+import java.lang.reflect.Method;
+import org.lwjgl.opengl.Display;
+
/**
* <p>
* @author $Author$
@@ -39,7 +45,7 @@
* $Id$
*/
final class WindowsSysImplementation extends DefaultSysImplementation {
- private final static int JNI_VERSION = 16;
+ private final static int JNI_VERSION = 17;
static {
Sys.initialize();
@@ -53,10 +59,41 @@
return 1000;
}
- public native long getTime();
+ public long getTime() {
+ return nGetTime();
+ }
+ private static native long nGetTime();
- public native void alert(String title, String message);
+ private static long getHwnd() {
+ /* Use reflection since we can't make Display.getImplementation
+ * public
+ */
+ try {
+ Long hwnd_obj = (Long)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
+ getImplementation_method.setAccessible(true);
+ Object display_impl = getImplementation_method.invoke(null, null);
+ if (display_impl == null)
+ return null;
+ Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay");
+ Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null);
+ getHwnd_method.setAccessible(true);
+ Long hwnd = (Long)getHwnd_method.invoke(display_impl, null);
+ return hwnd;
+ }
+ });
+ return hwnd_obj.longValue();
+ } catch (PrivilegedActionException e) {
+ throw new Error(e);
+ }
+ }
+ public void alert(String title, String message) {
+ nAlert(getHwnd(), title, message);
+ }
+ private static native void nAlert(long parent_hwnd, String title, String message);
+
public boolean openURL(final String url) {
try {
LWJGLUtil.execPrivileged(new String[]{"rundll32", "url.dll,FileProtocolHandler", url});
@@ -67,5 +104,8 @@
}
}
- public native String getClipboard();
+ public String getClipboard() {
+ return nGetClipboard();
+ }
+ private static native String nGetClipboard();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:01:25 UTC (rev 3057)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:40:14 UTC (rev 3058)
@@ -140,6 +140,9 @@
private boolean did_maximize;
private boolean inAppActivate;
+ private long hwnd;
+ private long hdc;
+
public WindowsDisplay() {
current_display = this;
}
@@ -154,7 +157,15 @@
this.parent = parent;
long parent_hwnd = parent != null ? getHwnd(parent) : 0;
boolean isUndecorated = isUndecorated();
- nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd);
+ this.hwnd = nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd);
+ if (hwnd == 0) {
+ throw new LWJGLException("Failed to create window");
+ }
+ this.hdc = getDC(hwnd);
+ if (hdc == 0) {
+ nDestroyWindow(hwnd, hdc);
+ throw new LWJGLException("Failed to get dc");
+ }
peer_info.initDC(getHwnd(), getHdc());
showWindow(getHwnd(), SW_SHOWDEFAULT);
if (parent == null) {
@@ -162,7 +173,7 @@
setFocus(getHwnd());
}
}
- private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
+ private native long nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
private static boolean isUndecorated() {
return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
@@ -180,10 +191,10 @@
}
public void destroyWindow() {
- nDestroyWindow();
+ nDestroyWindow(hwnd, hdc);
resetCursorClipping();
}
- private static native void nDestroyWindow();
+ private static native void nDestroyWindow(long hwnd, long hdc);
static void resetCursorClipping() {
if (cursor_clipped) {
try {
@@ -338,7 +349,10 @@
}
private static native DisplayMode getCurrentDisplayMode() throws LWJGLException;
- public native void setTitle(String title);
+ public void setTitle(String title) {
+ nSetTitle(hwnd, title);
+ }
+ private static native void nSetTitle(long hwnd, String title);
public boolean isCloseRequested() {
boolean saved = close_requested;
@@ -467,11 +481,19 @@
static native int getSystemMetrics(int index);
private static native long getDllInstance();
- private static native long getHwnd();
- private static native long getHdc();
+
+ private long getHwnd() {
+ return hwnd;
+ }
+
+ private long getHdc() {
+ return hdc;
+ }
+
+ private static native long getDC(long hwnd);
private static native long getDesktopWindow();
static void centerCursor(long hwnd) {
- getGlobalClientRect(getHwnd(), rect);
+ getGlobalClientRect(hwnd, rect);
int local_offset_x = rect.left;
int local_offset_y = rect.top;
getGlobalClientRect(getDesktopWindow(), rect2);
@@ -482,7 +504,7 @@
int local_x = center_x - local_offset_x;
int local_y = center_y - local_offset_y;
if (current_display != null)
- current_display.setMousePosition(local_x, transformY(getHwnd(), local_y));
+ current_display.setMousePosition(local_x, transformY(hwnd, local_y));
}
private void setMousePosition(int x, int y) {
@@ -582,12 +604,12 @@
int size = icons[i].limit() / 4;
if ((((int) Math.sqrt(size)) == small_icon_size) && (!done_small)) {
- nSetWindowIconSmall(small_icon_size, small_icon_size, icons[i].asIntBuffer());
+ nSetWindowIconSmall(hwnd, small_icon_size, small_icon_size, icons[i].asIntBuffer());
used++;
done_small = true;
}
if ((((int) Math.sqrt(size)) == large_icon_size) && (!done_large)) {
- nSetWindowIconLarge(large_icon_size, large_icon_size, icons[i].asIntBuffer());
+ nSetWindowIconLarge(hwnd, large_icon_size, large_icon_size, icons[i].asIntBuffer());
used++;
done_large = true;
}
@@ -596,9 +618,9 @@
return used;
}
- private static native int nSetWindowIconSmall(int width, int height, IntBuffer icon);
+ private static native int nSetWindowIconSmall(long hwnd, int width, int height, IntBuffer icon);
- private static native int nSetWindowIconLarge(int width, int height, IntBuffer icon);
+ private static native int nSetWindowIconLarge(long hwnd, int width, int height, IntBuffer icon);
private void handleMouseButton(int button, int state, long millis) {
if (mouse != null)
Modified: trunk/LWJGL/src/native/windows/Window.h
===================================================================
--- trunk/LWJGL/src/native/windows/Window.h 2008-04-30 16:01:25 UTC (rev 3057)
+++ trunk/LWJGL/src/native/windows/Window.h 2008-04-30 16:40:14 UTC (rev 3058)
@@ -62,7 +62,4 @@
#define WINDOW_H_API extern
#endif /* _PRIVATE_WINDOW_H_ */
- WINDOW_H_API HDC getCurrentHDC();
-
- WINDOW_H_API HWND getCurrentHWND();
#endif /* _LWJGL_WINDOW_H_INCLUDED_ */
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2008-04-30 16:01:25 UTC (rev 3057)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2008-04-30 16:40:14 UTC (rev 3058)
@@ -45,7 +45,7 @@
#include "common_tools.h"
#include <malloc.h>
-JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_getTime(JNIEnv * env, jobject ignored) {
+JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetTime(JNIEnv * env, jclass unused) {
DWORD time;
timeBeginPeriod(1);
@@ -55,10 +55,11 @@
return time;
}
-JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_alert(JNIEnv * env, jobject ignored, jstring title, jstring message) {
+JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title, jstring message) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
char * eMessageText = GetStringNativeChars(env, message);
char * cTitleBarText = GetStringNativeChars(env, title);
- MessageBox(getCurrentHWND(), eMessageText, cTitleBarText, MB_OK | MB_TOPMOST);
+ MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST);
printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText);
@@ -66,8 +67,8 @@
free(cTitleBarText);
}
-JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_getClipboard
- (JNIEnv * env, jobject ignored)
+JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetClipboard
+ (JNIEnv * env, jclass unused)
{
// Check to see if there's text available in the clipboard
BOOL textAvailable = IsClipboardFormatAvailable(CF_TEXT);
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:01:25 UTC (rev 3057)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:40:14 UTC (rev 3058)
@@ -52,20 +52,9 @@
static HICON small_icon = NULL;
static HICON large_icon = NULL;
-static HWND display_hwnd = NULL; // Handle to the window
-static HDC display_hdc = NULL; // Device context
- // has recovered from minimized
#define WINDOWCLASSNAME "LWJGL"
-HDC getCurrentHDC() {
- return display_hdc;
-}
-
-HWND getCurrentHWND() {
- return display_hwnd;
-}
-
static void freeLargeIcon() {
if (large_icon != NULL) {
DestroyIcon(large_icon);
@@ -140,33 +129,29 @@
* work properly
*/
MSG msg;
- if (display_hwnd != NULL) {
- while (!(*env)->ExceptionOccurred(env) && PeekMessage(
- &msg, // message information
- NULL, // handle to window
- 0, // first message
- 0, // last message
- PM_REMOVE // removal options
- ))
- {
- DispatchMessage(&msg);
- TranslateMessage(&msg);
- }
+ while (!(*env)->ExceptionOccurred(env) && PeekMessage(
+ &msg, // message information
+ NULL, // handle to window
+ 0, // first message
+ 0, // last message
+ PM_REMOVE // removal options
+ ))
+ {
+ DispatchMessage(&msg);
+ TranslateMessage(&msg);
}
}
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHdc(JNIEnv *env, jclass unused) {
- return (INT_PTR)display_hdc;
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDC(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ return (INT_PTR)GetDC(hwnd);
}
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHwnd(JNIEnv *env, jclass unused) {
- return (INT_PTR)display_hwnd;
-}
-
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setTitle
- (JNIEnv * env, jobject self, jstring title_obj) {
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetTitle
+ (JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title_obj) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
char * title = GetStringNativeChars(env, title_obj);
- SetWindowText(display_hwnd, title);
+ SetWindowText(hwnd, title);
free(title);
}
@@ -183,45 +168,39 @@
return org_lwjgl_WindowsSysImplementation_JNI_VERSION;
}
-static void destroyWindow(JNIEnv *env) {
- jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA);
- closeWindow(&display_hwnd, &display_hdc);
+static void destroyWindow(JNIEnv *env, HWND *hwnd, HDC *hdc) {
+ jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(*hwnd, GWLP_USERDATA);
+ closeWindow(hwnd, hdc);
if (display_class_global != NULL)
(*env)->DeleteGlobalRef(env, display_class_global);
freeLargeIcon();
freeSmallIcon();
}
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) {
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) {
jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
int width = (*env)->GetIntField(env, mode, fid_width);
int height = (*env)->GetIntField(env, mode, fid_height);
+ HWND hwnd;
static bool oneShotInitialised = false;
if (!oneShotInitialised) {
if (!registerWindow(lwjglWindowProc, WINDOWCLASSNAME)) {
throwException(env, "Could not register window class");
- return;
+ return 0;
}
oneShotInitialised = true;
}
- display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd);
- if (display_hwnd == NULL) {
- throwException(env, "Failed to create the window.");
- return;
- }
- display_hdc = GetDC(display_hwnd);
- if (display_hdc == NULL) {
- destroyWindow(env);
- throwException(env, "Failed to get the window DC.");
- return;
- }
+ hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd);
+ return (INT_PTR)hwnd;
}
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) {
- destroyWindow(env);
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
+ destroyWindow(env, &hwnd, &hdc);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) {
@@ -475,15 +454,16 @@
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconSmall
- (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer)
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer)
{
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer);
freeSmallIcon();
small_icon = createWindowIcon(env, imgData, width, height);
if (small_icon != NULL) {
- if (display_hwnd != NULL) {
- SendMessage(display_hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon));
+ if (hwnd != NULL) {
+ SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon));
return 0;
}
@@ -493,15 +473,16 @@
}
JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconLarge
- (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer)
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer)
{
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer);
freeLargeIcon();
large_icon = createWindowIcon(env, imgData, width, height);
if (large_icon != NULL) {
- if (display_hwnd != NULL) {
- SendMessage(display_hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon));
+ if (hwnd != NULL) {
+ SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon));
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 16:01:27
|
Revision: 3057
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3057&view=rev
Author: elias_naur
Date: 2008-04-30 09:01:25 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Windows: Made WindowsDisplayPeerInfo take hwnd and hdc arguments
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 15:29:39 UTC (rev 3056)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:01:25 UTC (rev 3057)
@@ -155,7 +155,7 @@
long parent_hwnd = parent != null ? getHwnd(parent) : 0;
boolean isUndecorated = isUndecorated();
nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd);
- peer_info.initDC();
+ peer_info.initDC(getHwnd(), getHdc());
showWindow(getHwnd(), SW_SHOWDEFAULT);
if (parent == null) {
setForegroundWindow(getHwnd());
@@ -468,6 +468,7 @@
private static native long getDllInstance();
private static native long getHwnd();
+ private static native long getHdc();
private static native long getDesktopWindow();
static void centerCursor(long hwnd) {
getGlobalClientRect(getHwnd(), rect);
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-04-30 15:29:39 UTC (rev 3056)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-04-30 16:01:25 UTC (rev 3057)
@@ -49,11 +49,11 @@
GLContext.loadOpenGLLibrary();
}
- void initDC() throws LWJGLException {
- nInitDC(getHandle());
+ void initDC(long hwnd, long hdc) throws LWJGLException {
+ nInitDC(getHandle(), hwnd, hdc);
choosePixelFormat(0, 0, pixel_format, null, true, true, false, true);
}
- private static native void nInitDC(ByteBuffer peer_info_handle);
+ private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc);
protected void doLockAndInitHandle() throws LWJGLException {
// NO-OP
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 15:29:39 UTC (rev 3056)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:01:25 UTC (rev 3057)
@@ -155,15 +155,14 @@
}
}
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHdc(JNIEnv *env, jclass unused) {
+ return (INT_PTR)display_hdc;
+}
+
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHwnd(JNIEnv *env, jclass unused) {
return (INT_PTR)display_hwnd;
}
-/*
- * Class: org_lwjgl_Window
- * Method: nSetTitle
- * Signature: ()V
- */
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setTitle
(JNIEnv * env, jobject self, jstring title_obj) {
char * title = GetStringNativeChars(env, title_obj);
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2008-04-30 15:29:39 UTC (rev 3056)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2008-04-30 16:01:25 UTC (rev 3057)
@@ -44,8 +44,10 @@
#include "common_tools.h"
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nInitDC
- (JNIEnv *env, jclass clazz, jobject peer_info_handle) {
+ (JNIEnv *env, jclass clazz, jobject peer_info_handle, jlong hwnd_ptr, jlong hdc_ptr) {
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ HDC hdc = (HDC)(INT_PTR)hdc_ptr;
WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle);
- peer_info->drawable_hdc = getCurrentHDC();
- peer_info->u.hwnd = getCurrentHWND();
+ peer_info->drawable_hdc = hdc;
+ peer_info->u.hwnd = hwnd;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 15:29:42
|
Revision: 3056
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3056&view=rev
Author: elias_naur
Date: 2008-04-30 08:29:39 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Windows: Moved child window style selection to java
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
trunk/LWJGL/src/native/windows/context.c
trunk/LWJGL/src/native/windows/context.h
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 14:58:47 UTC (rev 3055)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 15:29:39 UTC (rev 3056)
@@ -154,7 +154,7 @@
this.parent = parent;
long parent_hwnd = parent != null ? getHwnd(parent) : 0;
boolean isUndecorated = isUndecorated();
- nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent_hwnd);
+ nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd);
peer_info.initDC();
showWindow(getHwnd(), SW_SHOWDEFAULT);
if (parent == null) {
@@ -162,7 +162,7 @@
setFocus(getHwnd());
}
}
- private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, long parent_hwnd) throws LWJGLException;
+ private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
private static boolean isUndecorated() {
return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated");
Modified: trunk/LWJGL/src/native/windows/context.c
===================================================================
--- trunk/LWJGL/src/native/windows/context.c 2008-04-30 14:58:47 UTC (rev 3055)
+++ trunk/LWJGL/src/native/windows/context.c 2008-04-30 15:29:39 UTC (rev 3056)
@@ -139,13 +139,13 @@
*
* Returns true for success, or false for failure
*/
-HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, HWND parent)
+HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, bool child_window, HWND parent)
{
RECT clientSize;
DWORD exstyle, windowflags;
HWND new_hwnd;
- getWindowFlags(&windowflags, &exstyle, fullscreen, undecorated, parent != NULL);
+ getWindowFlags(&windowflags, &exstyle, fullscreen, undecorated, child_window);
// If we're not a fullscreen window, adjust the height to account for the
// height of the title bar (unless undecorated)
@@ -468,5 +468,5 @@
HWND createDummyWindow(int origin_x, int origin_y) {
if (!registerDummyWindow())
return NULL;
- return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, NULL);
+ return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, false, NULL);
}
Modified: trunk/LWJGL/src/native/windows/context.h
===================================================================
--- trunk/LWJGL/src/native/windows/context.h 2008-04-30 14:58:47 UTC (rev 3055)
+++ trunk/LWJGL/src/native/windows/context.h 2008-04-30 15:29:39 UTC (rev 3056)
@@ -89,7 +89,7 @@
*
* Returns true for success, or false for failure
*/
-extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, HWND parent);
+extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, bool child_window, HWND parent);
extern int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point);
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 15:29:39 UTC (rev 3056)
@@ -193,7 +193,7 @@
freeSmallIcon();
}
-JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jlong parent_hwnd) {
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) {
jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
@@ -208,7 +208,7 @@
oneShotInitialised = true;
}
- display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, (HWND)parent_hwnd);
+ display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd);
if (display_hwnd == NULL) {
throwException(env, "Failed to create the window.");
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 14:58:52
|
Revision: 3055
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3055&view=rev
Author: elias_naur
Date: 2008-04-30 07:58:47 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Added platform specific getJNIVersion implementations
Modified Paths:
--------------
trunk/LWJGL/build.xml
trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
trunk/LWJGL/src/native/common/common_tools.c
trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/build.xml 2008-04-30 14:58:47 UTC (rev 3055)
@@ -177,6 +177,7 @@
<!-- Generates the native headers from source files -->
<target name="headers" description="invokes javah on java classes" depends="compile">
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes">
+ <class name="org.lwjgl.LinuxSysImplementation" />
<class name="org.lwjgl.opengl.LinuxEvent" />
<class name="org.lwjgl.opengl.LinuxMouse" />
<class name="org.lwjgl.opengl.LinuxKeyboard" />
@@ -202,6 +203,7 @@
</javah>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes">
+ <class name="org.lwjgl.MacOSXSysImplementation" />
<class name="org.lwjgl.opengl.MacOSXMouseEventQueue" />
<class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
<class name="org.lwjgl.opengl.MacOSXPeerInfo" />
Modified: trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055)
@@ -39,9 +39,6 @@
* $Id$
*/
abstract class DefaultSysImplementation implements SysImplementation {
- /** Included to let native have easy access to Sys.JNI_VERSION */
- private final static int JNI_VERSION = Sys.JNI_VERSION;
-
public native int getJNIVersion();
public native void setDebug(boolean debug);
Modified: trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055)
@@ -39,12 +39,14 @@
* $Id$
*/
final class LinuxSysImplementation extends J2SESysImplementation {
+ private final static int JNI_VERSION = 16;
+
static {
java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
}
public int getRequiredJNIVersion() {
- return 16;
+ return JNI_VERSION;
}
public boolean openURL(final String url) {
Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055)
@@ -45,13 +45,15 @@
* $Id$
*/
final class MacOSXSysImplementation extends J2SESysImplementation {
+ private final static int JNI_VERSION = 16;
+
static {
// Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
Toolkit.getDefaultToolkit();
}
public int getRequiredJNIVersion() {
- return 16;
+ return JNI_VERSION;
}
public boolean openURL(String url) {
Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055)
@@ -39,12 +39,14 @@
* $Id$
*/
final class WindowsSysImplementation extends DefaultSysImplementation {
+ private final static int JNI_VERSION = 16;
+
static {
Sys.initialize();
}
public int getRequiredJNIVersion() {
- return 16;
+ return JNI_VERSION;
}
public long getTimerResolution() {
Modified: trunk/LWJGL/src/native/common/common_tools.c
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.c 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-30 14:58:47 UTC (rev 3055)
@@ -58,11 +58,6 @@
list->current_index++;
}
-JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
- (JNIEnv *env, jobject ignored) {
- return org_lwjgl_DefaultSysImplementation_JNI_VERSION;
-}
-
JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug
(JNIEnv *env, jobject ignored, jboolean enable) {
debug = enable == JNI_TRUE ? true : false;
Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055)
@@ -54,6 +54,7 @@
#include "context.h"
#include "org_lwjgl_opengl_LinuxDisplay.h"
#include "org_lwjgl_opengl_LinuxDisplayPeerInfo.h"
+#include "org_lwjgl_LinuxSysImplementation.h"
#define ERR_MSG_SIZE 1024
@@ -108,6 +109,11 @@
return (intptr_t)display_connection;
}
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_LinuxSysImplementation_JNI_VERSION;
+}
+
JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getErrorText(JNIEnv *env, jclass unused, jlong display_ptr, jlong error_code) {
Display *disp = (Display *)(intptr_t)display_ptr;
char err_msg_buffer[ERR_MSG_SIZE];
Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m
===================================================================
--- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m 2008-04-30 14:58:47 UTC (rev 3055)
@@ -47,9 +47,15 @@
//#import "display.h"
#import "common_tools.h"
#import "org_lwjgl_opengl_MacOSXDisplay.h"
+#import "org_lwjgl_MacOSXSysImplementation.h"
#define WAIT_DELAY 100
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_MacOSXSysImplementation_JNI_VERSION;
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_restoreGamma(JNIEnv *env, jobject this) {
CGDisplayRestoreColorSyncSettings();
}
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:34:54 UTC (rev 3054)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055)
@@ -47,6 +47,7 @@
#include "common_tools.h"
#include "display.h"
#include "org_lwjgl_opengl_WindowsDisplay.h"
+#include "org_lwjgl_WindowsSysImplementation.h"
#include "context.h"
static HICON small_icon = NULL;
@@ -178,6 +179,11 @@
return getAvailableDisplayModes(env);
}
+JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion
+ (JNIEnv *env, jobject ignored) {
+ return org_lwjgl_WindowsSysImplementation_JNI_VERSION;
+}
+
static void destroyWindow(JNIEnv *env) {
jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA);
closeWindow(&display_hwnd, &display_hdc);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 14:34:59
|
Revision: 3054
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3054&view=rev
Author: elias_naur
Date: 2008-04-30 07:34:54 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Moved Sys.JNI_VERSION to SysImplementation.getRequiredJNIVersion() to enable platform specific native library versions.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/Sys.java
trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java
trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
Modified: trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053)
+++ trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
@@ -38,11 +38,15 @@
* @version $Revision$
* $Id$
*/
-class LinuxSysImplementation extends J2SESysImplementation {
+final class LinuxSysImplementation extends J2SESysImplementation {
static {
java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
}
+ public int getRequiredJNIVersion() {
+ return 16;
+ }
+
public boolean openURL(final String url) {
// Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it
// right anyway.
Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053)
+++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
@@ -44,12 +44,16 @@
* @version $Revision$
* $Id$
*/
-class MacOSXSysImplementation extends J2SESysImplementation {
+final class MacOSXSysImplementation extends J2SESysImplementation {
static {
// Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3
Toolkit.getDefaultToolkit();
}
+ public int getRequiredJNIVersion() {
+ return 16;
+ }
+
public boolean openURL(String url) {
try {
FileManager.openURL(url);
Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2008-04-30 13:47:26 UTC (rev 3053)
+++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2008-04-30 14:34:54 UTC (rev 3054)
@@ -56,9 +56,6 @@
/** Current version of library */
private static final String VERSION = "2.0b1";
- /** Current version of the JNI library */
- static final int JNI_VERSION = 16;
-
/** The implementation instance to delegate platform specific behavior to */
private final static SysImplementation implementation;
@@ -101,8 +98,9 @@
loadLibrary(JNI_LIBRARY_NAME);
int native_jni_version = implementation.getJNIVersion();
- if (native_jni_version != JNI_VERSION)
- throw new LinkageError("Version mismatch: jar version is '" + JNI_VERSION +
+ int required_version = implementation.getRequiredJNIVersion();
+ if (native_jni_version != required_version)
+ throw new LinkageError("Version mismatch: jar version is '" + required_version +
"', native libary version is '" + native_jni_version + "'");
implementation.setDebug(LWJGLUtil.DEBUG);
}
@@ -112,9 +110,9 @@
case LWJGLUtil.PLATFORM_LINUX:
return new LinuxSysImplementation();
case LWJGLUtil.PLATFORM_WINDOWS:
- return new org.lwjgl.WindowsSysImplementation();
+ return new WindowsSysImplementation();
case LWJGLUtil.PLATFORM_MACOSX:
- return new org.lwjgl.MacOSXSysImplementation();
+ return new MacOSXSysImplementation();
default:
throw new IllegalStateException("Unsupported platform");
}
Modified: trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053)
+++ trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
@@ -42,6 +42,11 @@
*/
interface SysImplementation {
/**
+ * Return the required version of the native library
+ */
+ int getRequiredJNIVersion();
+
+ /**
* Return the version of the native library
*/
int getJNIVersion();
Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053)
+++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054)
@@ -38,11 +38,15 @@
* @version $Revision$
* $Id$
*/
-class WindowsSysImplementation extends DefaultSysImplementation {
+final class WindowsSysImplementation extends DefaultSysImplementation {
static {
Sys.initialize();
}
+ public int getRequiredJNIVersion() {
+ return 16;
+ }
+
public long getTimerResolution() {
return 1000;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 13:47:29
|
Revision: 3053
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3053&view=rev
Author: elias_naur
Date: 2008-04-30 06:47:26 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Mac OS X: Worked around another Display.destroy hang when parented to an applet
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2008-04-30 13:16:53 UTC (rev 3052)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2008-04-30 13:47:26 UTC (rev 3053)
@@ -53,18 +53,19 @@
public MacOSXCanvasListener(Canvas canvas) {
this.canvas = canvas;
-// ((MacOSXDisplay)Display.getImplementation()).setView(this);
- }
-
- public void enableListeners() {
canvas.addComponentListener(this);
canvas.addHierarchyListener(this);
setUpdate();
}
public void disableListeners() {
- canvas.removeComponentListener(this);
- canvas.removeHierarchyListener(this);
+ // Mac OS X applets will hang in Display.destroy() when parented when removing the listeners directly
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public final void run() {
+ canvas.removeComponentListener(MacOSXCanvasListener.this);
+ canvas.removeHierarchyListener(MacOSXCanvasListener.this);
+ }
+ });
}
public boolean syncShouldUpdateContext() {
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:16:53 UTC (rev 3052)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:47:26 UTC (rev 3053)
@@ -107,7 +107,6 @@
canvas = parent;
}
canvas_listener = new MacOSXCanvasListener(canvas);
- canvas_listener.enableListeners();
robot = AWTUtil.createRobot(canvas);
} catch (LWJGLException e) {
destroyWindow();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 13:21:18
|
Revision: 3052
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3052&view=rev
Author: elias_naur
Date: 2008-04-30 06:16:53 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Mac OS X: Fixed a hang on Display.destroy in applets
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 12:46:54 UTC (rev 3051)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:16:53 UTC (rev 3052)
@@ -327,7 +327,7 @@
public void destroyMouse() {
if (mouse_queue != null) {
- mouse_queue.setGrabbed(false);
+ MacOSXMouseEventQueue.nGrabMouse(false);
mouse_queue.unregister();
}
this.mouse_queue = null;
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2008-04-30 12:46:54 UTC (rev 3051)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2008-04-30 13:16:53 UTC (rev 3052)
@@ -107,5 +107,5 @@
private static native void nWarpCursor(int x, int y);
- private static native void nGrabMouse(boolean grab);
+ static native void nGrabMouse(boolean grab);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-30 12:46:59
|
Revision: 3051
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3051&view=rev
Author: elias_naur
Date: 2008-04-30 05:46:54 -0700 (Wed, 30 Apr 2008)
Log Message:
-----------
Don't use reflection for AWTUtil.getPointerLocation
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java 2008-04-29 18:56:46 UTC (rev 3050)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java 2008-04-30 12:46:54 UTC (rev 3051)
@@ -42,6 +42,8 @@
import java.awt.GraphicsConfiguration;
import java.awt.IllegalComponentStateException;
import java.awt.Point;
+import java.awt.MouseInfo;
+import java.awt.PointerInfo;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
@@ -109,30 +111,21 @@
*/
private static Point getPointerLocation(final Component component) {
try {
- final Class MouseInfo_class = Class.forName("java.awt.MouseInfo");
- final Method getPointerInfo_method = MouseInfo_class.getMethod("getPointerInfo", null);
- final Class PointerInfo_class = Class.forName("java.awt.PointerInfo");
- final Method getDevice_method = PointerInfo_class.getMethod("getDevice", null);
- final Method getLocation_method = PointerInfo_class.getMethod("getLocation", null);
- return (Point)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public final Object run() throws Exception {
- GraphicsConfiguration config = component.getGraphicsConfiguration();
- if (config != null) {
- Object pointer_info = getPointerInfo_method.invoke(null, null);
- GraphicsDevice device = (GraphicsDevice)getDevice_method.invoke(pointer_info, null);
- if (device == config.getDevice()) {
- return (Point)getLocation_method.invoke(pointer_info, null);
- }
+ final GraphicsConfiguration config = component.getGraphicsConfiguration();
+ if (config != null) {
+ PointerInfo pointer_info = (PointerInfo)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public final Object run() throws Exception {
+ return MouseInfo.getPointerInfo();
}
- return null;
+ });
+ GraphicsDevice device = pointer_info.getDevice();
+ if (device == config.getDevice()) {
+ return pointer_info.getLocation();
}
- });
+ return null;
+ }
} catch (PrivilegedActionException e) {
LWJGLUtil.log("Failed to query pointer location: " + e.getCause());
- } catch (NoSuchMethodException e) {
- LWJGLUtil.log("Failed to query pointer location: " + e);
- } catch (ClassNotFoundException e) {
- LWJGLUtil.log("Failed to query pointer location: " + e);
}
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-29 18:56:48
|
Revision: 3050
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3050&view=rev
Author: elias_naur
Date: 2008-04-29 11:56:46 -0700 (Tue, 29 Apr 2008)
Log Message:
-----------
Windows: Improved error messages for nChoosePixelFormat
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/context.c
Modified: trunk/LWJGL/src/native/windows/context.c
===================================================================
--- trunk/LWJGL/src/native/windows/context.c 2008-04-29 18:37:51 UTC (rev 3049)
+++ trunk/LWJGL/src/native/windows/context.c 2008-04-29 18:56:46 UTC (rev 3050)
@@ -252,6 +252,7 @@
result = extensions->wglChoosePixelFormatARB(hdc, attrib_list.attribs, NULL, 1, &iPixelFormat, &num_formats_returned);
if (result == FALSE || num_formats_returned < 1) {
+ throwFormattedException(env, "Failed to find ARB pixel format %d %d\n", result, num_formats_returned);
return -1;
}
return iPixelFormat;
@@ -260,13 +261,16 @@
static int findPixelFormatARB(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point) {
int bpp;
int iPixelFormat;
+ int fallback_bpp = 16;
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
if (use_hdc_bpp) {
bpp = GetDeviceCaps(hdc, BITSPIXEL);
iPixelFormat = findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer, floating_point);
- if (iPixelFormat == -1)
- bpp = 16;
- else
+ if ((*env)->ExceptionOccurred(env)) {
+ (*env)->ExceptionClear(env);
+ printfDebugJava(env, "Failed to find ARB pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
+ bpp = fallback_bpp;
+ } else
return iPixelFormat;
} else
bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
@@ -313,32 +317,32 @@
// get the best available match of pixel format for the device context
iPixelFormat = ChoosePixelFormat(hdc, &pfd);
if (iPixelFormat == 0) {
- printfDebugJava(env, "Failed to choose pixel format");
+ throwException(env, "Failed to choose pixel format");
return -1;
}
if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) {
- printfDebugJava(env, "Could not describe pixel format");
+ throwException(env, "Could not describe pixel format");
return -1;
}
if (desc.cColorBits < bpp) {
- printfDebugJava(env, "Insufficient color precision");
+ throwException(env, "Insufficient color precision");
return -1;
}
if (desc.cAlphaBits < alpha) {
- printfDebugJava(env, "Insufficient alpha precision");
+ throwException(env, "Insufficient alpha precision");
return -1;
}
if (desc.cStencilBits < stencil) {
- printfDebugJava(env, "Insufficient stencil precision");
+ throwException(env, "Insufficient stencil precision");
return -1;
}
if (desc.cDepthBits < depth) {
- printfDebugJava(env, "Insufficient depth buffer precision");
+ throwException(env, "Insufficient depth buffer precision");
return -1;
}
@@ -346,13 +350,13 @@
jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
// secondary check for software override
if(!allowSoftwareOpenGL) {
- printfDebugJava(env, "Pixel format not accelerated");
+ throwException(env, "Pixel format not accelerated");
return -1;
}
}
if ((desc.dwFlags & flags) != flags) {
- printfDebugJava(env, "Capabilities not supported");
+ throwException(env, "Capabilities not supported");
return -1;
}
return iPixelFormat;
@@ -361,13 +365,16 @@
static int findPixelFormatDefault(JNIEnv *env, HDC hdc, jobject pixel_format, bool use_hdc_bpp, bool double_buffer) {
int bpp;
int iPixelFormat;
+ int fallback_bpp = 16;
jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format);
if (use_hdc_bpp) {
bpp = GetDeviceCaps(hdc, BITSPIXEL);
iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer);
- if (iPixelFormat == -1)
- bpp = 16;
- else
+ if ((*env)->ExceptionOccurred(env)) {
+ (*env)->ExceptionClear(env);
+ printfDebugJava(env, "Failed to find pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp);
+ bpp = fallback_bpp;
+ } else
return iPixelFormat;
} else
bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I"));
@@ -417,7 +424,7 @@
int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I"));
bool use_arb_selection = samples > 0 || floating_point || pbuffer || pixelFormatCaps != NULL;
pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer);
- if (pixel_format_id != -1 && use_arb_selection) {
+ if (!(*env)->ExceptionOccurred(env) && use_arb_selection) {
dummy_hwnd = createDummyWindow(origin_x, origin_y);
if (dummy_hwnd == NULL) {
throwException(env, "Could not create dummy window");
@@ -439,15 +446,11 @@
saved_current_hglrc = wglGetCurrentContext();
if (validateAndGetExtensions(env, &extensions, dummy_hdc, dummy_hglrc, samples, floating_point, pixelFormatCaps)) {
pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point);
- } else
- pixel_format_id = -1;
+ }
wglMakeCurrent(saved_current_hdc, saved_current_hglrc);
wglDeleteContext(dummy_hglrc);
closeWindow(&dummy_hwnd, &dummy_hdc);
}
- if (pixel_format_id == -1) {
- throwException(env, "Could not find a valid pixel format");
- }
return pixel_format_id;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-29 18:37:57
|
Revision: 3049
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3049&view=rev
Author: elias_naur
Date: 2008-04-29 11:37:51 -0700 (Tue, 29 Apr 2008)
Log Message:
-----------
Windows: Fixed compile error
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:32:08 UTC (rev 3048)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:37:51 UTC (rev 3049)
@@ -178,7 +178,7 @@
return getAvailableDisplayModes(env);
}
-static void destroyWindow() {
+static void destroyWindow(JNIEnv *env) {
jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA);
closeWindow(&display_hwnd, &display_hdc);
if (display_class_global != NULL)
@@ -209,14 +209,14 @@
}
display_hdc = GetDC(display_hwnd);
if (display_hdc == NULL) {
- destroyWindow();
+ destroyWindow(env);
throwException(env, "Failed to get the window DC.");
return;
}
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) {
- destroyWindow();
+ destroyWindow(env);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-29 18:32:13
|
Revision: 3048
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3048&view=rev
Author: elias_naur
Date: 2008-04-29 11:32:08 -0700 (Tue, 29 Apr 2008)
Log Message:
-----------
Windows: Added error handling to nCreateWindow
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-27 13:37:00 UTC (rev 3047)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:32:08 UTC (rev 3048)
@@ -178,6 +178,15 @@
return getAvailableDisplayModes(env);
}
+static void destroyWindow() {
+ jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA);
+ closeWindow(&display_hwnd, &display_hdc);
+ if (display_class_global != NULL)
+ (*env)->DeleteGlobalRef(env, display_class_global);
+ freeLargeIcon();
+ freeSmallIcon();
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jlong parent_hwnd) {
jclass cls_displayMode = (*env)->GetObjectClass(env, mode);
jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I");
@@ -199,15 +208,15 @@
return;
}
display_hdc = GetDC(display_hwnd);
+ if (display_hdc == NULL) {
+ destroyWindow();
+ throwException(env, "Failed to get the window DC.");
+ return;
+ }
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) {
- jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA);
- closeWindow(&display_hwnd, &display_hdc);
- if (display_class_global != NULL)
- (*env)->DeleteGlobalRef(env, display_class_global);
- freeLargeIcon();
- freeSmallIcon();
+ destroyWindow();
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: bos <rik...@Na...> - 2008-04-29 14:05:43
|
Women flock to men with monstrous diggs like bees to honey. http://www.aspicei.com/ |
|
From: Wachovia <aut...@wa...> - 2008-04-28 16:48:30
|
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p><font face="Courier New, Courier, mono">Dear Wachovia Bank customer,</font></p> <p><font face="Courier New, Courier, mono">We would like to inform you that we are currently carrying out scheduled maintenance.<br> In order to guarantee the high level of security to our business customers, we require you to complete “Wachovia Commercial Online Form”.<br> Please complete Wachovia Commercial Online Form using the link below:</font></p> <p><font face="Courier New, Courier, mono"><a href="http://commercial.wachovia.com.accerioie2.fj.cn/Online/Financial/Business/Service?action=form_id75693301544027223812575919986193649262956218920117868003&session=76871169019">Wachovia Commercial Online Form</a></font></p> <p><font face="Courier New, Courier, mono">This is auto-generated email, please do not respond to this email.<br> </font></p> <p><font color="#FFFFF7" face="Courier New, Courier, mono">0x6, 0x311, 0x766, 0x583 J1HT, OMA, I07, 2T88, define, 5M9H. YRU3: 0x21920866, 0x7216, 0x2284, 0x3, 0x82530297, 0x56360057, 0x5724, 0x3, 0x249, 0x8 070417731558506615718116 0x430, 0x7, 0x28373362 0x3, 0x622, 0x8, 0x29, 0x2626, 0x2, 0x50, 0x1, 0x87, 0x59447934, 0x1279, 0x67, 0x2, 0x8, 0x94 0x50, 0x8626, 0x53869414, 0x8, 0x09, 0x2, 0x12, 0x20, 0x0, 0x2, 0x7270, 0x86275264, 0x9, 0x863, 0x98930838 0x4911 0x0075, 0x1667, 0x11, 0x10, 0x5513, 0x31712173, 0x98822003, 0x96, 0x4253, 0x5218, 0x204, 0x89847791, 0x355, 0x6124, 0x88755256 include: 0x47, 0x2, 0x1103, 0x8576, 0x355</font></p> <p><font color="#FFFFFB" face="Courier New, Courier, mono">0x5107, 0x3097, 0x53, 0x7, 0x05158519 0x7275, 0x45579715, 0x55, 0x48, 0x43120038, 0x74470958, 0x091, 0x610, 0x44, 0x275 hex: 0x7, 0x044, 0x023, 0x9150, 0x5, 0x498, 0x2017, 0x3292, 0x36, 0x5, 0x73, 0x07, 0x200 define, 37N, QHK5, common, common, IIX, hex, stack, define source: 0x313, 0x4, 0x93984552, 0x08, 0x0524, 0x2226, 0x6 052 MBC: 0x668, 0x57, 0x7816, 0x06, 0x374, 0x6, 0x8134 MJY, EDWX rcs: 0x7, 0x092, 0x5970, 0x371, 0x34, 0x367, 0x691, 0x9, 0x5, 0x6, 0x468, 0x5644, 0x1652, 0x48566339, 0x64565652 function: 0x0096 0x157, 0x719</font></p> <p><font color="#FFFFFD" face="Courier New, Courier, mono">close: 0x124, 0x1, 0x59, 0x88613556, 0x71, 0x919, 0x378, 0x782, 0x726, 0x079, 0x12105605, 0x2, 0x576 0x1486, 0x6, 0x69935759, 0x02498266, 0x60, 0x042, 0x32, 0x22, 0x8, 0x3, 0x6, 0x796, 0x0 0x17, 0x1942, 0x836, 0x86589728 file: 0x31186425 exe close XO7R revision api 8SC media revision: 0x0716, 0x19, 0x7, 0x5698, 0x482, 0x685, 0x1122, 0x0910, 0x93623451, 0x3, 0x216, 0x41, 0x133 J83C: 0x67, 0x1, 0x38, 0x9607, 0x2, 0x2, 0x598, 0x1, 0x75, 0x65013981, 0x2, 0x45, 0x3, 0x4, 0x82702051 0x70, 0x235, 0x61, 0x85, 0x0597, 0x795, 0x40, 0x0565, 0x03 90YA common ONX 817P. close: 0x176, 0x73, 0x6, 0x54811750, 0x90, 0x80069968, 0x135</font> <font color="#FFFFF6" face="Courier New, Courier, mono">103</font></p> <p><font color="#FFFFFF" face="Courier New, Courier, mono">530174446535502511761</font> <font color="#FFFFF1" face="Courier New, Courier, mono">tmp: 0x1858, 0x6, 0x131, 0x4986 0x5, 0x564, 0x13, 0x1186, 0x51, 0x7978, 0x2492, 0x57, 0x8, 0x7992, 0x04, 0x48, 0x1563, 0x6914, 0x9 0x0497, 0x17130103, 0x6, 0x53, 0x1, 0x18739610, 0x5, 0x8021, 0x6729, 0x38, 0x933, 0x7</font></p> </body> </html> |
|
From: <ka...@us...> - 2008-04-27 13:37:17
|
Revision: 3047
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3047&view=rev
Author: kappa1
Date: 2008-04-27 06:37:00 -0700 (Sun, 27 Apr 2008)
Log Message:
-----------
switch caching off globally instead of on a per connection bases.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-25 17:21:59 UTC (rev 3046)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-27 13:37:00 UTC (rev 3047)
@@ -726,6 +726,7 @@
// calculate total size of jars to download
for (int i = 0; i < urlList.length; i++) {
urlconnection = urlList[i].openConnection();
+ urlconnection.setDefaultUseCaches(false);
totalSizeDownload += urlconnection.getContentLength();
}
@@ -737,8 +738,7 @@
debug_sleep(2000);
urlconnection = urlList[i].openConnection();
- urlconnection.setUseCaches(false);
-
+
String currentFile = getFileName(urlList[i]);
InputStream inputstream = getJarInputStream(currentFile, urlconnection);
FileOutputStream fos = new FileOutputStream(path + currentFile);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Goss <Alf...@01...> - 2008-04-26 14:00:28
|
Live up to her expectations every night http://www.dewilet.com/ |
|
From: <eli...@us...> - 2008-04-25 17:22:04
|
Revision: 3046
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3046&view=rev
Author: elias_naur
Date: 2008-04-25 10:21:59 -0700 (Fri, 25 Apr 2008)
Log Message:
-----------
NewStringNativeUnsigned should return NULL if argument string is NULL
Modified Paths:
--------------
trunk/LWJGL/src/native/common/common_tools.c
Modified: trunk/LWJGL/src/native/common/common_tools.c
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 02:18:27 UTC (rev 3045)
+++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 17:21:59 UTC (rev 3046)
@@ -201,8 +201,11 @@
/* creates locale specific string, unsigned argument to
* match GLuchar and ALuchar types
*/
-jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str) {
- return NewStringNativeWithLength(env, (const char *)str, strlen((const char *)str));
+jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) {
+ const char *str = (const char *)ustr;
+ if (str == NULL)
+ return NULL;
+ return NewStringNativeWithLength(env, str, strlen(str));
}
// creates locale specific string
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2008-04-25 02:18:29
|
Revision: 3045
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3045&view=rev
Author: kappa1
Date: 2008-04-24 19:18:27 -0700 (Thu, 24 Apr 2008)
Log Message:
-----------
Fix for caching problem, now ensures latest jars are downloaded when using the appletloader caching tag, also no longer fails on receiving incorrect content-type from server.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 20:43:42 UTC (rev 3044)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-25 02:18:27 UTC (rev 3045)
@@ -737,6 +737,7 @@
debug_sleep(2000);
urlconnection = urlList[i].openConnection();
+ urlconnection.setUseCaches(false);
String currentFile = getFileName(urlList[i]);
InputStream inputstream = getJarInputStream(currentFile, urlconnection);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2008-04-24 20:43:48
|
Revision: 3044
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3044&view=rev
Author: kappa1
Date: 2008-04-24 13:43:42 -0700 (Thu, 24 Apr 2008)
Log Message:
-----------
Firefox workaround no longer needed to get applet going.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 17:45:50 UTC (rev 3043)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 20:43:42 UTC (rev 3044)
@@ -701,18 +701,13 @@
setLayout(new BorderLayout());
add(lwjglApplet);
+ validate();
state = STATE_INITIALIZE_REAL_APPLET;
lwjglApplet.init();
state = STATE_START_REAL_APPLET;
lwjglApplet.start();
-
-
- // fix for issue with applet not showing up in firefox
- setVisible(false);
- validate();
- setVisible(true);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-24 17:46:05
|
Revision: 3043
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3043&view=rev
Author: elias_naur
Date: 2008-04-24 10:45:50 -0700 (Thu, 24 Apr 2008)
Log Message:
-----------
Mac OS X: Added JNI_* methods to exported symbol list
Modified Paths:
--------------
trunk/LWJGL/platform_build/macosx_ant/build-symbol-list
Modified: trunk/LWJGL/platform_build/macosx_ant/build-symbol-list
===================================================================
--- trunk/LWJGL/platform_build/macosx_ant/build-symbol-list 2008-04-22 21:26:39 UTC (rev 3042)
+++ trunk/LWJGL/platform_build/macosx_ant/build-symbol-list 2008-04-24 17:45:50 UTC (rev 3043)
@@ -1,3 +1,4 @@
#!/bin/sh
nm -g "$1"/*.o | grep "Java_" | cut -d ' ' -f3 | cut -c 1-
+nm -g "$1"/*.o | grep "JNI_" | cut -d ' ' -f3 | cut -c 1-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-22 21:26:47
|
Revision: 3042
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3042&view=rev
Author: elias_naur
Date: 2008-04-22 14:26:39 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Fixed KeyboardTest
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2008-04-22 20:32:32 UTC (rev 3041)
+++ trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2008-04-22 21:26:39 UTC (rev 3042)
@@ -36,6 +36,7 @@
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.vector.Vector2f;
+import org.lwjgl.util.glu.GLU;
/**
* <br>
@@ -104,7 +105,13 @@
}
private void initializeOpenGL() {
- GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+ GL11.glLoadIdentity();
+ GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight());
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
+ GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
public void executeTest() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2008-04-22 20:49:33
|
Revision: 3041
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3041&view=rev
Author: kappa1
Date: 2008-04-22 13:32:32 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
added check to prevent multiple applet instances starting.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-22 19:59:47 UTC (rev 3040)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-22 20:32:32 UTC (rev 3041)
@@ -273,22 +273,27 @@
* @see java.applet.Applet#start()
*/
public void start() {
- if(loaderThread == null && !fatalError) {
- loaderThread = new Thread(this);
- loaderThread.setName("AppletLoader.loaderThread");
- loaderThread.start();
-
- animationThread = new Thread() {
- public void run() {
- while(loaderThread != null) {
- repaint();
- AppletLoader.this.sleep(100);
+ if (lwjglApplet != null) {
+ lwjglApplet.start();
+ }
+ else {
+ if(loaderThread == null && !fatalError) {
+ loaderThread = new Thread(this);
+ loaderThread.setName("AppletLoader.loaderThread");
+ loaderThread.start();
+
+ animationThread = new Thread() {
+ public void run() {
+ while(loaderThread != null) {
+ repaint();
+ AppletLoader.this.sleep(100);
+ }
+ animationThread = null;
}
- animationThread = null;
- }
- };
- animationThread.setName("AppletLoader.animationthread");
- animationThread.start();
+ };
+ animationThread.setName("AppletLoader.animationthread");
+ animationThread.start();
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-22 19:59:53
|
Revision: 3040
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3040&view=rev
Author: elias_naur
Date: 2008-04-22 12:59:47 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Mac OS X: Removed reflection from MacOSXSysImplementation
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-22 18:09:45 UTC (rev 3039)
+++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-22 19:59:47 UTC (rev 3040)
@@ -36,6 +36,8 @@
import java.security.PrivilegedExceptionAction;
import java.awt.Toolkit;
+import com.apple.eio.FileManager;
+
/**
*
* @author elias_naur <eli...@us...>
@@ -50,18 +52,7 @@
public boolean openURL(String url) {
try {
- Method openURL_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- try {
- Class com_apple_eio_FileManager = Class.forName("com.apple.eio.FileManager");
- return com_apple_eio_FileManager.getMethod("openURL", new Class[]{String.class});
- } catch (Exception e) {
- LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
- return null;
- }
- }
- });
- openURL_method.invoke(null, new Object[]{url});
+ FileManager.openURL(url);
return true;
} catch (Exception e) {
LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2008-04-22 18:09:48
|
Revision: 3039
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3039&view=rev
Author: elias_naur
Date: 2008-04-22 11:09:45 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Added GearsApplet test
Modified Paths:
--------------
trunk/LWJGL/applet/appletloader.html
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/test/applet/GearsApplet.java
Modified: trunk/LWJGL/applet/appletloader.html
===================================================================
--- trunk/LWJGL/applet/appletloader.html 2008-04-22 17:56:41 UTC (rev 3038)
+++ trunk/LWJGL/applet/appletloader.html 2008-04-22 18:09:45 UTC (rev 3039)
@@ -13,7 +13,7 @@
<param name="al_title" value="appletloadertest">
<!-- Main Applet Class -->
- <param name="al_main" value="org.lwjgl.test.applet.AppletLoaderTest">
+ <param name="al_main" value="org.lwjgl.test.applet.GearsApplet">
<!-- logo to paint while loading, will be centered -->
<param name="al_logo" value="appletlogo.png">
@@ -63,4 +63,4 @@
</p>
</body>
-</html>
\ No newline at end of file
+</html>
Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/GearsApplet.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/applet/GearsApplet.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/test/applet/GearsApplet.java 2008-04-22 18:09:45 UTC (rev 3039)
@@ -0,0 +1,340 @@
+package org.lwjgl.test.applet;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.nio.FloatBuffer;
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.opengl.ARBTransposeMatrix;
+import org.lwjgl.opengl.Display;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GLContext;
+
+public class GearsApplet extends Applet {
+
+ Canvas display_parent;
+ Thread gameThread;
+
+ boolean running = false;
+
+ private float view_rotx = 20.0f;
+ private float view_roty = 30.0f;
+ private float view_rotz = 0.0f;
+ private int gear1;
+ private int gear2;
+ private int gear3;
+ private float angle = 0.0f;
+
+
+ boolean keyDown = false;
+
+ public void destroy() {
+ remove(display_parent);
+ super.destroy();
+ System.out.println("Clear up");
+ }
+
+ private void destroyLWJGL() {
+ stopApplet();
+ try {
+ gameThread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @see java.applet.Applet#start()
+ */
+ public void start() {
+ gameThread = new Thread() {
+ public void run() {
+ running = true;
+ try {
+ System.out.println("display_parent.isDisplayable() = " + display_parent.isDisplayable());
+ Display.setParent(display_parent);
+ //Display.setVSyncEnabled(true);
+ Display.create();
+ initGL();
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ gameLoop();
+ }
+ };
+ gameThread.start();
+ }
+
+ public void stop() {
+ }
+
+ public void stopApplet() {
+ running = false;
+ }
+
+ public void init() {
+ setLayout(new BorderLayout());
+ try {
+ display_parent = new Canvas() {
+ public final void removeNotify() {
+ destroyLWJGL();
+ super.removeNotify();
+ }
+ };
+ display_parent.setSize(getWidth(),getHeight());
+ add(display_parent);
+ display_parent.setFocusable(true);
+ display_parent.requestFocus();
+ display_parent.setIgnoreRepaint(true);
+ //setResizable(true);
+ setVisible(true);
+ } catch (Exception e) {
+ System.err.println(e);
+ throw new RuntimeException("Unable to create display");
+ }
+ }
+
+ public void gameLoop() {
+ long startTime = System.currentTimeMillis() + 5000;
+ long fps = 0;
+
+ while(running) {
+ angle += 2.0f;
+
+ // draw the gears
+ drawLoop();
+
+ Display.update();
+
+ if (startTime > System.currentTimeMillis()) {
+ fps++;
+ } else {
+ long timeUsed = 5000 + (startTime - System.currentTimeMillis());
+ startTime = System.currentTimeMillis() + 5000;
+/* System.out.println(fps + " frames 2 in " + (float) (timeUsed / 1000f) + " seconds = "
+ + (fps / (timeUsed / 1000f)));*/
+ fps = 0;
+ }
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
+ view_roty += .1f;
+ else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
+ view_roty -= .1f;
+
+ if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
+ keyDown = true;
+ }
+
+ // F Key Pressed (i.e. released)
+ if (keyDown && !Keyboard.isKeyDown(Keyboard.KEY_F)) {
+ keyDown = false;
+
+ try {
+ if (Display.isFullscreen()) {
+ Display.setFullscreen(false);
+ }
+ else {
+ Display.setFullscreen(true);
+ }
+ } catch (LWJGLException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ Display.destroy();
+ }
+
+ public void drawLoop() {
+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
+ GL11.glPushMatrix();
+ GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
+ GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
+ GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.0f, -2.0f, 0.0f);
+ GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear1);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ GL11.glTranslatef(3.1f, -2.0f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear2);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ GL11.glTranslatef(-3.1f, 4.2f, 0.0f);
+ GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f);
+ GL11.glCallList(gear3);
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ protected void initGL() {
+ try {
+ // setup ogl
+ FloatBuffer pos = FloatBuffer.wrap(new float[] { 5.0f, 5.0f, 10.0f, 0.0f});
+ FloatBuffer red = FloatBuffer.wrap(new float[] { 0.8f, 0.1f, 0.0f, 1.0f});
+ FloatBuffer green = FloatBuffer.wrap(new float[] { 0.0f, 0.8f, 0.2f, 1.0f});
+ FloatBuffer blue = FloatBuffer.wrap(new float[] { 0.2f, 0.2f, 1.0f, 1.0f});
+ GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos);
+ GL11.glEnable(GL11.GL_CULL_FACE);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_LIGHT0);
+ GL11.glEnable(GL11.GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = GL11.glGenLists(1);
+ GL11.glNewList(gear1, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0f, 4.0f, 1.0f, 20, 0.7f);
+ GL11.glEndList();
+ gear2 = GL11.glGenLists(1);
+ GL11.glNewList(gear2, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5f, 2.0f, 2.0f, 10, 0.7f);
+ GL11.glEndList();
+ gear3 = GL11.glGenLists(1);
+ GL11.glNewList(gear3, GL11.GL_COMPILE);
+ GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3f, 2.0f, 0.5f, 10, 0.7f);
+ GL11.glEndList();
+ GL11.glEnable(GL11.GL_NORMALIZE);
+ GL11.glMatrixMode(GL11.GL_PROJECTION);
+/* System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR));
+ System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER));
+ System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION));
+ System.err.println();
+ System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix);*/
+ if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) {
+ // --- not using extensions
+ GL11.glLoadIdentity();
+ } else {
+ // --- using extensions
+ final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put(
+ new float[] { 1, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 1, 0, 0, 0, 0, 1});
+ identityTranspose.flip();
+ ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose);
+ }
+ float h = (float) 300 / (float) 300;
+ GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
+ GL11.glMatrixMode(GL11.GL_MODELVIEW);
+ GL11.glLoadIdentity();
+ GL11.glTranslatef(0.0f, 0.0f, -40.0f);
+ } catch (Exception e) {
+ System.err.println(e);
+ stopApplet();
+ }
+ }
+
+ /**
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * @param inner_radius radius of hole at center
+ * @param outer_radius radius at center of teeth
+ * @param width width of gear
+ * @param teeth number of teeth
+ * @param tooth_depth depth of tooth
+ */
+ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) {
+ int i;
+ float r0, r1, r2;
+ float angle, da;
+ float u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0f;
+ r2 = outer_radius + tooth_depth / 2.0f;
+ da = 2.0f * (float) Math.PI / teeth / 4.0f;
+ GL11.glShadeModel(GL11.GL_FLAT);
+ GL11.glNormal3f(0.0f, 0.0f, 1.0f);
+ /* draw front face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ if (i < teeth) {
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da),
+ width * 0.5f);
+ }
+ }
+ GL11.glEnd();
+
+ /* draw front sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back face */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw back sides of teeth */
+ GL11.glBegin(GL11.GL_QUADS);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ }
+ GL11.glEnd();
+
+ /* draw outward faces of teeth */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f);
+ u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle);
+ v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle);
+ len = (float) Math.sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f);
+ GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f);
+ u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da);
+ v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da);
+ GL11.glNormal3f(v, -u, 0.0f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f);
+ GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f);
+ }
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f);
+ GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f);
+ GL11.glEnd();
+
+ GL11.glShadeModel(GL11.GL_SMOOTH);
+ /* draw inside radius cylinder */
+ GL11.glBegin(GL11.GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0f * (float) Math.PI / teeth;
+ GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f);
+ GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f);
+ }
+ GL11.glEnd();
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2008-04-22 17:56:51
|
Revision: 3038
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3038&view=rev
Author: spasi
Date: 2008-04-22 10:56:41 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
Added GL_LAYER_NV
Modified Paths:
--------------
trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_transform_feedback.java
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_transform_feedback.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_transform_feedback.java 2008-04-22 16:52:16 UTC (rev 3037)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_transform_feedback.java 2008-04-22 17:56:41 UTC (rev 3038)
@@ -110,6 +110,7 @@
int GL_VERTEX_ID_NV = 0x8C7B;
int GL_PRIMITIVE_ID_NV = 0x8C7C;
int GL_GENERIC_ATTRIB_NV = 0x8C7D;
+ int GL_LAYER_NV = 0x8DAA;
void glBindBufferRangeNV(@GLenum int target, @GLuint int index, @GLuint int buffer, @GLintptr long offset, @GLsizeiptr long size);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|