diff --git a/src/java/org/lwjgl/opengl/Window.java b/src/java/org/lwjgl/opengl/Window.java index 7a720e1d..c4fb2533 100644 --- a/src/java/org/lwjgl/opengl/Window.java +++ b/src/java/org/lwjgl/opengl/Window.java @@ -208,7 +208,7 @@ public final class Window { * If you are writing a straightforward game rendering loop and simply paint * every frame regardless, you can ignore this flag altogether. If you are * trying to be kind to other processes you can check this flag and only - * redraw when it returns true. The flag is cleared when you call paint(). + * redraw when it returns true. The flag is cleared when swapBuffers() is caleld. * * @return true if the window has been damaged by external changes * and needs to repaint itself @@ -229,13 +229,15 @@ public final class Window { public static void update() { if (!isCreated()) throw new IllegalStateException("Cannot update uncreated window"); - nUpdate(); - // We paint only when the window is visible, and either dirty or active. - if (isVisible() && (isDirty() || isActive())) { + // We paint only when the window is visible or dirty + if (isVisible() || isDirty()) { Util.checkGLError(); swapBuffers(); } + + nUpdate(); + // Poll the input devices while we're here if (Mouse.isCreated()) { Mouse.poll(); diff --git a/src/native/linux/org_lwjgl_opengl_Window.cpp b/src/native/linux/org_lwjgl_opengl_Window.cpp index a00b8210..f2c78a06 100644 --- a/src/native/linux/org_lwjgl_opengl_Window.cpp +++ b/src/native/linux/org_lwjgl_opengl_Window.cpp @@ -68,6 +68,7 @@ static int current_width; static bool input_released; +static bool isUndecorated; static bool dirty; static bool vsync_enabled; static bool minimized; @@ -462,7 +463,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate bool fscreen = false; if (fullscreen == JNI_TRUE) fscreen = true; - bool isUndecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); + isUndecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); if (!extgl_Open()) { throwException(env, "Could not load gl libs"); @@ -526,9 +527,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_swapBuffers(JNIEnv * env, jc */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Window_nIsDirty (JNIEnv *env, jclass clazz) { - bool result = dirty; - dirty = false; - return result ? JNI_TRUE : JNI_FALSE; + return dirty ? JNI_TRUE : JNI_FALSE; } /*