{"id":291471,"date":"2018-10-28T11:45:02","date_gmt":"2018-10-28T08:45:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291471"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291471","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u0438\u0433\u0440\u0443 \u043d\u0430 LWJGL"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<h1>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u043d\u0430 LWJGL #1 <\/h1>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e 3D \u0438\u0433\u0440\u0443 \u043d\u0430 Java \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 LWJGL. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0439 \u0438\u0433\u0440\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423\u043c\u0435\u043d\u0438\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 Java (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c: \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u0446\u0438\u043a\u043b\u043e\u0432, \u0441\u0442\u0440\u043e\u043a, \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u043e\u0432)<\/li>\n<li>\u0421\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (\u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Eclipse)<\/li>\n<li>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 LWJGL<\/li>\n<li>\u0412\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f OpengGL \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u043d\u0438\u0436\u0435 3.3<\/li>\n<li>\u0421\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f<\/li>\n<li>\u0418\u0434\u0435\u044f<\/li>\n<\/ul>\n<p>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>  <a href=\"https:\/\/vertex-academy.com\/tutorials\/ru\/ustanovka-zapusk-eclipse\/\">\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Eclipse<\/a>.<br \/>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"https:\/\/sourceforge.net\/projects\/java-game-lib\/files\/Official%20Releases\/LWJGL%202.9.3\/\">LWJGL 2.9.3<\/a>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 3D \u0433\u0440\u0430\u0444\u0438\u043a\u0438, <a href=\"http:\/\/basehomesite.ucoz.ru\/forum\/15-22-1\">\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c<\/a> \u0435\u0451 \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c <a href=\"http:\/\/slick.ninjacave.com\/slick-util\/\">slick-util<\/a>, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0443\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<h2>\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Main \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 main, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ie\/y4\/bw\/iey4bw60d2rj7jl-jpx85ass_yk.png\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 input \u043d\u0435 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0451 \u043e\u043a (\u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0435 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0436\u0435\u043b\u0442\u044b\u043c, \u0442.\u043a. \u0434\u0430\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0435\u0449\u0451 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435).<\/p>\n<h2>\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439, \u0434\u0438\u0441\u043f\u043b\u0435\u0439<\/h2>\n<p>  \u041d\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Main \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode;  public class Main { \tstatic int width = 800, height = 600; \tstatic DisplayMode mainDisplayMode = new DisplayMode(width, height); \tstatic boolean running = true; \t \tstatic void update() { \t\tif (Display.wasResized()) { \t\t\twidth = Display.getWidth(); \t\t\theight = Display.getHeight();         \t} \t\tDisplay.update();\t    \t     \t\tDisplay.sync(60);     \t \t\tif (Display.isCloseRequested()) {         \t\trunning = false;         \t} \t} \t \tpublic static void main(String[] args) { \t\ttry { \t\tDisplay.setLocation( \t\t(Display.getDesktopDisplayMode().getWidth() - mainDisplayMode.getWidth()) \/ 2,  \t\tDisplay.getDesktopDisplayMode().getHeight() - mainDisplayMode.getHeight()) \/ 2);     \t\tDisplay.setResizable(true);             \tDisplay.setVSyncEnabled(true);         \tDisplay.setDisplayMode(mainDisplayMode);             \tDisplay.create();                      } catch (LWJGLException ex) {             \tSystem.err.println(ex.getStackTrace().toString());             \tDisplay.destroy();             \tSystem.exit(1);         } \t\t \t\twhile (running) { \t\t\t \t\t\tupdate();         \t}                  \tDisplay.destroy();         \tSystem.exit(0); \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:  <\/p>\n<pre><code class=\"java\">Display.setLocation( (Display.getDesktopDisplayMode().getWidth() - mainDisplayMode.getWidth()) \/ 2, (Display.getDesktopDisplayMode().getHeight() - mainDisplayMode.getHeight()) \/ 2);  Display.setResizable(true); Display.setVSyncEnabled(true); Display.setDisplayMode(mainDisplayMode); Display.create(); <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445: <br \/>  1. \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u044f (\u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043a\u0440\u0430\u043d\u0430)<br \/>  2. \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440<br \/>  3. \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f<br \/>  4. \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f DisplayMode \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<br \/>  5. \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<pre><code class=\"java\">static void update() { \tif (Display.wasResized()) { \t\twidth = Display.getWidth(); \t\theight = Display.getHeight();         } \tDisplay.update();\t    \t     \tDisplay.sync(60);     \t \tif (Display.isCloseRequested()) {         \trunning = false;         } } <\/code><\/pre>\n<p>  \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 update, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435:<br \/>  1. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043e\u043a\u043d\u0430<br \/>  2. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u044f<br \/>  3. \u0412 \u0441\u0442\u0440\u043e\u043a\u0435 Display.sync(60) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0441 60 \u0433\u0435\u0440\u0446\u0430\u043c\u0438 (\u0435\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u0434\u0440\u0443\u0433\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 59, 76, 120, 144 \u0438 \u0442.\u0434., \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u0441\u0432\u043e\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443).<br \/>  4. \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u043a\u0440\u0435\u0441\u0442\u0438\u043a, \u0444\u043b\u0430\u0433 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430, Display.isCloseRequested(), \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f true, \u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f running \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f false, \u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b while(running) \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c Display.destroy(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438 System.exit(0), \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<h2>\u0428\u0430\u0433 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439, OpenGL<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c OpenGL \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e main \u043f\u0435\u0440\u0435\u0434 \u0446\u0438\u043a\u043b\u043e\u043c while(running) \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"java\">if (!GLContext.getCapabilities().OpenGL33) {         System.err.println(\"\u0412\u0430\u0448\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenGL 3.3.\");         System.exit(0); } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenGL 3.3, \u0435\u0441\u043b\u0438 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443 (\u0435\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439).<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430, \u0435\u0441\u043b\u0438 \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenGL 3.3, \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0434\u043e \u0446\u0438\u043a\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"java\">glShadeModel(GL_SMOOTH); glEnable(GL_TEXTURE_2D); glEnable(GL_DEPTH_TEST); glClearColor(1f, 0f, 0f, 1f); <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442 OpenGL \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  1. \u0412\u043a\u043b\u044e\u0447\u0438\u0442 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0430\u0445 \u043c\u044f\u0433\u043a\u043e\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435<br \/>  2. \u0412\u043a\u043b\u044e\u0447\u0438\u0442 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b<br \/>  3. \u0412\u043a\u043b\u044e\u0447\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0433\u043b\u0443\u0431\u0438\u043d\u044b (\u0447\u0442\u043e\u0431\u044b \u0431\u043b\u0438\u0436\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0434\u0430\u043b\u044c\u043d\u0438\u0435)<br \/>  4. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0446\u0432\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0438<\/p>\n<p>  \u0412 \u0446\u0438\u043a\u043b while(running), \u0434\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 update(), \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443   <\/p>\n<pre><code class=\"java\">glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); <\/code><\/pre>\n<p>  \u041a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0431\u0443\u0444\u0435\u0440 \u0433\u043b\u0443\u0431\u0438\u043d\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u0434<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0436\u043c\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT; import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT; import static org.lwjgl.opengl.GL11.GL_DEPTH_TEST; import static org.lwjgl.opengl.GL11.GL_SMOOTH; import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D; import static org.lwjgl.opengl.GL11.glClear; import static org.lwjgl.opengl.GL11.glClearColor; import static org.lwjgl.opengl.GL11.glEnable; import static org.lwjgl.opengl.GL11.glShadeModel;  import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GLContext;   public class Main { \tstatic int width = 800, height = 600; \tstatic DisplayMode mainDisplayMode = new DisplayMode(width, height); \tstatic boolean running = true; \t \tstatic void update() { \t\tif (Display.wasResized()) { \t\t\twidth = Display.getWidth(); \t\t\theight = Display.getHeight();         } \t\tDisplay.update();\t    \t     \tDisplay.sync(60);     \t \t\tif (Display.isCloseRequested()) {         \trunning = false;         } \t} \t \tpublic static void main(String[] args) { \t\ttry {     \t\tDisplay.setLocation((Display.getDesktopDisplayMode().getWidth() - mainDisplayMode.getWidth()) \/ 2, (Display.getDesktopDisplayMode().getHeight() - mainDisplayMode.getHeight()) \/ 2);     \t\tDisplay.setResizable(true);             Display.setVSyncEnabled(true);         \tDisplay.setDisplayMode(mainDisplayMode);             Display.create();                      } catch (LWJGLException ex) {             System.err.println(ex.getStackTrace().toString());             Display.destroy();             System.exit(1);         } \t\t \t\tif (!GLContext.getCapabilities().OpenGL33) {         \tSystem.err.println(\"\u0412\u0430\u0448\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenGL 3.3.\");             System.exit(0);         } \t\t \t\tglShadeModel(GL_SMOOTH);         glEnable(GL_TEXTURE_2D);         glEnable(GL_DEPTH_TEST);         glClearColor(1f, 0f, 0f, 1f);          \t\t \t\twhile (running) { \t\t\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); \t\t\t \t\t\tupdate();         }                  Display.destroy();         System.exit(0); \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u0433\u0440\u044b \u043d\u0430 LWJGL, \u0435\u0441\u043b\u0438 \u0432 \u043e\u043f\u0440\u043e\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 50% \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439.<\/p><\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/427979\/\"> https:\/\/habr.com\/post\/427979\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<h1>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u043d\u0430 LWJGL #1 <\/h1>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b \u2014 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e 3D \u0438\u0433\u0440\u0443 \u043d\u0430 Java \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 LWJGL. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0439 \u0438\u0433\u0440\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423\u043c\u0435\u043d\u0438\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 Java (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c: \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0441\u043b\u043e\u0432\u0438\u0439, \u0446\u0438\u043a\u043b\u043e\u0432, \u0441\u0442\u0440\u043e\u043a, \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u043e\u0432)<\/li>\n<li>\u0421\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (\u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Eclipse)<\/li>\n<li>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 LWJGL<\/li>\n<li>\u0412\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0430, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f OpengGL \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u043d\u0438\u0436\u0435 3.3<\/li>\n<li>\u0421\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f<\/li>\n<li>\u0418\u0434\u0435\u044f<\/li>\n<\/ul>\n<p>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-291471","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291471"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291471\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}