Removed the eglSwapInterval call, rewrote v-sync to use the swap interval

This commit is contained in:
Boulay Mathias 2022-10-03 19:52:57 +02:00
parent 96d73f13a3
commit 9e70fc9a8e
4 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
1663700709650 1664111720511

View File

@ -34,7 +34,6 @@ bool gl_init() {
eglGetError_p()); eglGetError_p());
return false; return false;
} }
eglSwapInterval_p(g_EglDisplay, 1);
return true; return true;
} }

View File

@ -414,7 +414,7 @@ public class Display {
Display.drawable = drawable; Display.drawable = drawable;
context = org.lwjgl.opengl.GLContext.createFromCurrent(); context = org.lwjgl.opengl.GLContext.createFromCurrent();
glfwSwapInterval(0); //glfwSwapInterval(0);
glfwShowWindow(Window.handle); glfwShowWindow(Window.handle);
Mouse.create(); Mouse.create();
@ -762,6 +762,7 @@ public class Display {
public static void setVSyncEnabled(boolean sync) { public static void setVSyncEnabled(boolean sync) {
vsyncEnabled = sync; vsyncEnabled = sync;
glfwSwapInterval(vsyncEnabled ? 1 : 0);
} }
public static long getWindow() { public static long getWindow() {
@ -1046,9 +1047,9 @@ public class Display {
* - the desired frame rate, in frames per second * - the desired frame rate, in frames per second
*/ */
public static void sync(int fps) { public static void sync(int fps) {
if (vsyncEnabled) /*if (vsyncEnabled)
Sync.sync(60); Sync.sync(60);
else Sync.sync(fps); else*/ Sync.sync(fps);
} }
public static Drawable getDrawable() { public static Drawable getDrawable() {