feat(rendering): init window when show it
@@ -242,6 +242,8 @@ public class GLFWWindow implements Window {
@Override
public void show() {
+ if (pointer == NULL) init();
+
setShowing(true);
}
@@ -295,9 +297,11 @@ public class GLFWWindow implements Window {
@Override
public void dispose() {
- hide();
+ if (pointer == NULL) return;
+ hide();
glfwDestroyWindow(pointer);
+ pointer = NULL;
}
public long getPointer() {
@@ -383,13 +387,13 @@ public class GLFWWindow implements Window {
private void initWindowHint() {
glfwDefaultWindowHints();
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE);
- if (Boolean.parseBoolean(System.getProperty("glfw.debug", "false"))) {
+ if (Boolean.parseBoolean(System.getProperty("rendering.debug", "false"))) {
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
}
if (SystemUtils.IS_OS_MAC) {
