private void init() { if (glfwInit() != GL_TRUE) { System.err.println("Could not initialize GLFW!"); return; } glfwWindowHint(GLFW_SAMPLES, 4); glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); OSCompatibility.GLFWSpecifics(); window = glfwCreateWindow(width, height, "Voxel Engine", NULL, NULL); if (window == NULL) { System.err.println("Could not create GLFW window!"); return; } // Compatibility for screen with 1:X | X =/= 1 ratio ByteBuffer FBW = BufferUtils.createByteBuffer(4), FBH = BufferUtils.createByteBuffer(4); glfwGetFramebufferSize(window, FBW, FBH); pix_width = FBW.getInt(0); pix_height = FBH.getInt(0); InitWindow(); InitGL(); }
public void start() { running = true; OSCompatibility.Init(); run(); }