Fixed vsync bug

This commit is contained in:
Ioannis Tsakpinis 2004-03-28 20:29:52 +00:00
parent 9d55bbb302
commit 5fb7f5e0e2
1 changed files with 32 additions and 37 deletions

View File

@ -81,9 +81,6 @@ public final class Window {
/** Fullscreen */ /** Fullscreen */
private static boolean fullscreen; private static boolean fullscreen;
/** Vsync */
private static boolean vsync;
/** Tracks VBO state for the window context */ /** Tracks VBO state for the window context */
private static VBOTracker vbo_tracker; private static VBOTracker vbo_tracker;
@ -233,7 +230,7 @@ public final class Window {
*/ */
public static void update() { public static void update() {
if (!isCreated()) if (!isCreated())
throw new IllegalStateException("Cannot determine update uncreated window"); throw new IllegalStateException("Cannot update uncreated window");
nUpdate(); nUpdate();
if ((isDirty() && !isMinimized()) || (isFocused() && !isMinimized())) { if ((isDirty() && !isMinimized()) || (isFocused() && !isMinimized())) {
Util.checkGLError(); Util.checkGLError();
@ -351,8 +348,6 @@ public final class Window {
* @param bpp Minimum bits per pixel * @param bpp Minimum bits per pixel
* @param alpha Minimum bits per pixel in alpha buffer * @param alpha Minimum bits per pixel in alpha buffer
* @param depth Minimum bits per pixel in depth buffer * @param depth Minimum bits per pixel in depth buffer
* @param samples Minimum samples in multisample buffer (corresponds to GL_SAMPLES_ARB in GL_ARB_multisample spec).
Pass 0 to disable multisampling. This parameter is ignored if GL_ARB_multisample is not supported.
* @throws LWJGLException if the window could not be created for any reason; typically because * @throws LWJGLException if the window could not be created for any reason; typically because
* the minimum requirements could not be met satisfactorily * the minimum requirements could not be met satisfactorily
*/ */
@ -505,7 +500,7 @@ public final class Window {
/** /**
* Destroy the native window peer. * Destroy the native window peer.
*/ */
private native static void nDestroy(); private static native void nDestroy();
/** /**
* @return true if the window's native peer has been created * @return true if the window's native peer has been created
@ -530,7 +525,7 @@ public final class Window {
* @return boolean * @return boolean
*/ */
public static boolean isVSyncEnabled() { public static boolean isVSyncEnabled() {
if (isCreated()) if (!isCreated())
throw new IllegalStateException("Cannot determine vsync state of uncreated window"); throw new IllegalStateException("Cannot determine vsync state of uncreated window");
return nIsVSyncEnabled(); return nIsVSyncEnabled();
} }
@ -544,7 +539,7 @@ public final class Window {
* @param sync true to synchronize; false to ignore synchronization * @param sync true to synchronize; false to ignore synchronization
*/ */
public static void setVSyncEnabled(boolean sync) { public static void setVSyncEnabled(boolean sync) {
if (isCreated()) if (!isCreated())
throw new IllegalStateException("Cannot set vsync state of uncreated window"); throw new IllegalStateException("Cannot set vsync state of uncreated window");
nSetVSyncEnabled(sync); nSetVSyncEnabled(sync);
} }