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. |