Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static org.lwjgl.glfw.GLFW.*;
- import org.lwjgl.glfw.GLFWVidMode;
- public class Okno {
- public static void main(String[] args) {
- if(!glfwInit()) {
- throw new IllegalStateException("Błąd wczytania GLFW!");
- }
- glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
- long window = glfwCreateWindow(640, 480, "My LWGJL", 0, 0);
- if(window == 0) {
- throw new IllegalStateException("Nie można wczytać okna");
- }
- GLFWVidMode videoMode = glfwGetVideoMode(glfwGetPrimaryMonitor());
- glfwSetWindowPos(window, (videoMode.width() - 640)/2, (videoMode.height() - 480) /2);
- glfwShowWindow(window);
- while(!glfwWindowShouldClose(window)) {
- glfwPollEvents();
- }
- glfwTerminate();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement