From a4c28e7eeae56e515ac896e880ba63945de68cfb Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 4 Dec 2020 14:21:50 +0300 Subject: [PATCH] Init Idea project --- .idea/.gitignore | 3 + .idea/description.html | 1 + .idea/encodings.xml | 6 ++ .idea/libraries/lwjgl_release_3_2.xml | 13 +++ .idea/misc.xml | 9 ++ .idea/modules.xml | 8 ++ .idea/project-template.xml | 3 + OpenGL app.iml | 12 +++ .../untitled/com/company/Main.class | Bin 0 -> 3624 bytes src/site/rekovalev/Main.java | 86 ++++++++++++++++++ 10 files changed, 141 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/description.html create mode 100644 .idea/encodings.xml create mode 100644 .idea/libraries/lwjgl_release_3_2.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/project-template.xml create mode 100644 OpenGL app.iml create mode 100644 out/production/untitled/com/company/Main.class create mode 100644 src/site/rekovalev/Main.java diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..eaf91e2 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/description.html b/.idea/description.html new file mode 100644 index 0000000..db5f129 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..ab2dc53 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lwjgl_release_3_2.xml b/.idea/libraries/lwjgl_release_3_2.xml new file mode 100644 index 0000000..752a18d --- /dev/null +++ b/.idea/libraries/lwjgl_release_3_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3b8368f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ebb736b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100644 index 0000000..d57a956 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/OpenGL app.iml b/OpenGL app.iml new file mode 100644 index 0000000..268f1c1 --- /dev/null +++ b/OpenGL app.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/untitled/com/company/Main.class b/out/production/untitled/com/company/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..594b36af20ddb7a3afa0b0a09e04900556fcc0b7 GIT binary patch literal 3624 zcmcIn`*#~h75>IjytXuUVmWr2M^ia*gQU_ZNlR(4NlBF0kt(-om0GpiP*(C-+IY3A zu2y!;tE50F&+;fx0+do74XlDG3r5Sd{wuD+53gC9^Rd5GK7y}GFjj+arRnbiH9w-QV z{bPG1>e+GQAtRbm7zz=Y`#A=2C&P}CIwKOMkyq`kW*4bfu~oyaFdT?%oVkgy0N#a& zf+$A}chTZ(f|@}o%NTS**SDF~@c{93H^)KAzh81K2M%!@b_aCREK4Tu;kXy?AtvWE zW6GQ(f>Qy!7xybT$|*aB7;bCu;ig7H)%Bd3pP_Ji{FIyT5Ap%MkDDP0Lff! zQA!R)Z>dA8K8n){k{l_CBYZ2PMB+3>DpM`ZF(&iOCoD^vd6?r29$^UPDW7cN<`%=z z`l{TJZT};*498hKMm{Qn5_gbN?p6RPB8Du-bfYX zdd4QWr!M40*`_q_z&VCP!vn{{wU<|)uQ|0hYAdycFm>LnIjhgnd!crfp3Aib_sa=O z<^!0-Q?ktOlKxeWoTRf~`adbA)v8W4AT#SUC2PfpHu$8T;Fv~%pW%Mu3d4-C(6d;%BitY+raa?-GcHLL2B{t;T306vLNDfl$UbNEcl zv9W$SP!wJrB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ersion() + "!"); + + init(); + loop(); + + glfwFreeCallbacks(window); + glfwDestroyWindow(window); + + // Уничтожение GLFW и очистка + glfwTerminate(); + glfwSetErrorCallback(null).free(); + } + + private void init() { + // Вывод ошибок в STDERR + GLFWErrorCallback.createPrint(System.err).set(); + + // Инициализация glfw + if ( !glfwInit() ) + throw new IllegalStateException(" Ошибка инициализации GLFW"); + + // Конфиги + glfwDefaultWindowHints(); //загрузка стандартных значений параметров + glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); // Отключение возможности изменения размера окна + + // Создание окна + this.window = glfwCreateWindow(this.width, this.height, "Тестовое окно", NULL, NULL); + if ( this.window == NULL ) + throw new RuntimeException(" Ошибка создания окна"); + + // Лямбда-функция для обработки нажатия кнопок + glfwSetKeyCallback(window, (window, key, scancode, action, mods) -> { + if ( key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE ) + glfwSetWindowShouldClose(window, true); // Создает событие запроса на закрытие + }); + + glfwMakeContextCurrent(window);// Делаем контекст OpenGL + + glfwSwapInterval(1); // Вертикальная синхронизация + + } + + private void loop() { + // Требуется для LWJGL использующего GLFW + // LWJGL определяет контекст для текущего потока и привязывает GL функции к нему. + GL.createCapabilities(); + + + glClearColor(1.0f, 0.0f, 0.0f, 0.0f); // Цвет очистки + + + while ( !glfwWindowShouldClose(window) ) { //Цикл до события закрытия окна + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Очистка буферов + + /* + * код тут + */ + + glfwSwapBuffers(window); // перенос COLOR_BUFFER на окно + glfwPollEvents(); // обработка очереди событий + } + } + + public static void main(String[] args) { + new Main().run(); + } + +} \ No newline at end of file