This commit is contained in:
2021-03-09 21:03:39 +01:00
parent d0bfa6369a
commit a60925665b
3 changed files with 23 additions and 10 deletions

View File

@@ -0,0 +1,7 @@
package com.bartlomiejpluta.base.api.game.gui;
import com.bartlomiejpluta.base.api.internal.logic.Updatable;
import com.bartlomiejpluta.base.api.internal.render.Renderable;
public interface GUI extends Updatable, Renderable {
}

View File

@@ -51,7 +51,7 @@ public class DefaultRenderer implements Renderer {
} }
private void clear() { private void clear() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
} }
private void updateViewport(Screen screen) { private void updateViewport(Screen screen) {

View File

@@ -97,6 +97,9 @@ public class GLFWScreen implements Screen {
// Make the OpenGL context current // Make the OpenGL context current
glfwMakeContextCurrent(windowHandle); glfwMakeContextCurrent(windowHandle);
// Enable antialiasing
glfwWindowHint(GLFW_SAMPLES, 4);
// Enable V-Sync // Enable V-Sync
// glfwSwapInterval(1); // glfwSwapInterval(1);
@@ -109,6 +112,9 @@ public class GLFWScreen implements Screen {
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Required by GUI
glEnable(GL_STENCIL_TEST);
// Set the clear color // Set the clear color
clear(0.0f, 0.0f, 0.0f, 0.0f); clear(0.0f, 0.0f, 0.0f, 0.0f);
} }