From: <eli...@us...> - 2006-06-26 14:25:18
|
Revision: 2389 Author: elias_naur Date: 2006-06-26 07:24:45 -0700 (Mon, 26 Jun 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2389&view=rev Log Message: ----------- Windows: Moved is_dirty from native to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java trunk/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java 2006-06-26 14:13:57 UTC (rev 2388) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java 2006-06-26 14:24:45 UTC (rev 2389) @@ -62,6 +62,7 @@ private final static int WM_QUIT = 0x0012; private final static int WM_SYSCOMMAND = 0x0112; + private final static int WM_PAINT = 0x000F; private final static int SC_SIZE = 0xF000; private final static int SC_MOVE = 0xF010; @@ -90,9 +91,11 @@ private static WindowsMouse mouse; private static boolean close_requested; + private static boolean is_dirty; public void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException { close_requested = false; + is_dirty = false; nCreateWindow(mode, fullscreen, x, y); peer_info.initDC(); } @@ -136,14 +139,22 @@ private native String nGetVersion(String driver); public native DisplayMode init() throws LWJGLException; public native void setTitle(String title); + public boolean isCloseRequested() { boolean saved = close_requested; close_requested = false; return saved; } + public native boolean isVisible(); public native boolean isActive(); - public native boolean isDirty(); + + public boolean isDirty() { + boolean saved = is_dirty; + is_dirty = false; + return saved; + } + public PeerInfo createPeerInfo(PixelFormat pixel_format) throws LWJGLException { peer_info = new Win32DisplayPeerInfo(pixel_format); return peer_info; @@ -381,6 +392,9 @@ break; } return false; + case WM_PAINT: + is_dirty = true; + return false; default: return false; } Modified: trunk/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c 2006-06-26 14:13:57 UTC (rev 2388) +++ trunk/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c 2006-06-26 14:24:45 UTC (rev 2389) @@ -54,7 +54,6 @@ static bool isFullScreen = false; // Whether we're fullscreen or not static bool isMinimized = false; // Whether we're minimized or not static bool isFocused = false; // whether we're focused or not -static bool isDirty = false; // Whether we're dirty or not static bool isUndecorated = false; // Whether we're undecorated or not static bool did_maximize = false; // A flag to tell when a window // has recovered from minimized @@ -156,10 +155,6 @@ break; } break; - case WM_PAINT: - { - isDirty = true; - } } env = (JNIEnv *)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA); @@ -232,14 +227,6 @@ handleMessages(env); } - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Win32Display_isDirty - (JNIEnv *env, jobject self) { - bool result = isDirty; - isDirty = false; - return result ? JNI_TRUE : JNI_FALSE; -} - JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Win32Display_isVisible (JNIEnv *env, jobject self) { return isMinimized ? JNI_FALSE : JNI_TRUE; @@ -272,7 +259,6 @@ isMinimized = false; isFocused = false; - isDirty = true; isFullScreen = fullscreen == JNI_TRUE; isUndecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, isFullScreen, isUndecorated); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |