Init GUI #1
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class DefaultRenderer implements Renderer {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -97,6 +97,9 @@ public class GLFWScreen implements Screen {
|
||||
// Make the OpenGL context current
|
||||
glfwMakeContextCurrent(windowHandle);
|
||||
|
||||
// Enable antialiasing
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
|
||||
// Enable V-Sync
|
||||
// glfwSwapInterval(1);
|
||||
|
||||
@@ -109,6 +112,9 @@ public class GLFWScreen implements Screen {
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
// Required by GUI
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
|
||||
// Set the clear color
|
||||
clear(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user