Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the antispam-bee domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/ruwritingagame/public_html/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /home/ruwritingagame/public_html/wp-includes/functions.php:6131) in /home/ruwritingagame/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":335,"date":"2021-11-29T19:12:59","date_gmt":"2021-11-29T19:12:59","guid":{"rendered":"https:\/\/writingagame.com\/?p=335"},"modified":"2022-01-13T18:00:33","modified_gmt":"2022-01-13T18:00:33","slug":"chapter-4-printf-in-opengl-es","status":"publish","type":"post","link":"https:\/\/writingagame.ru\/index.php\/2021\/11\/29\/chapter-4-printf-in-opengl-es\/","title":{"rendered":"\u0413\u043b\u0430\u0432\u0430 4. Printf \u0432 OpenGL ES"},"content":{"rendered":"\n

\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u043c\u0435\u044f 2 OpenGL ES \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u043e\u0431\u0449\u0435\u0433\u043e \u0438 \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430.<\/p>\n\n\n\n

\u041e\u0431\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 GL context-\u0430, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441 \u043f\u043e\u043a\u0430\u0434\u0440\u043e\u0432\u044b\u043c rendering-\u043e\u043c, \u0432\u044b\u0445\u043e\u0434. GL \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0421\u043b\u0430\u0432\u0430 \u0411\u043e\u0433\u0443!) \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u043e\u0436\u0435 \u043f\u043e\u0445\u043e\u0436\u0435. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u043d\u0430 \u0438 GL-a, \u0432 GL-related \u0438\u043d\u043a\u043b\u044e\u0434\u0430\u0445 (gl\/egl \u043d\u0430 Android-\u0435 \u0438 glfw\/glad \u0432 Windows-\u0435). \u041f\u0440\u0438\u0435\u043c \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f.<\/p>\n\n\n\n

\u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0434\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c platform-specific \u0432\u0435\u0449\u0438 \u0432 2 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u0430 (\u043e\u0434\u0438\u043d \u0434\u043b\u044f PC \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f Android-\u0430).<\/p>\n\n\n\n

\u041d\u0430\u0447\u043d\u0435\u043c \u0441 printf-\u043e\u0431\u0440\u0410\u0437\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0434\u043b\u044f Windows \u0438 \u0434\u043b\u044f Android-\u0430. \u0421\u043f\u0435\u0440\u0432\u0430 \u043d\u0430<\/p>\n\n\n\n

Windows:<\/h2>\n\n\n\n
  1. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Visual Studio. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a999hello\\p_windows\\p_windows.sln<\/em><\/li><\/ol>\n\n\n\n
    \n\n\n\n

    2. \u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u043b\u044f \u043d\u0435\u0435 \u043c\u0435\u0441\u0442\u043e: right-click \u043d\u0430 \u201cp_windows<\/em> \u201d project -> Add -> New Filter<\/strong><\/em><\/p>\n\n\n\n

    \u0418\u043c\u044f – xPlatform<\/strong><\/p>\n\n\n\n


    \n\n\n\n

    3. \u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u0440\u0436\u0430\u0442\u044c Windows-specific \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 C:\\CPP\\p_windows<\/em> (\u0442\u0430\u043c \u0436\u0435 \u0433\u0434\u0435 \u0438 GLFW\/GLAD). \u041d\u0430\u0434\u043e \u043f\u0440\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u041f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u043a\u043b\u044e\u0434\u044b \u0438 \u0442\u0430\u043c \u0442\u043e\u0436\u0435:<\/p>\n\n\n\n

    Right-click \u043d\u0430 \u201cp_windows<\/strong>\u201d project -> Properties<\/em>, All configurations<\/strong>, Win32<\/strong>, Configuration properties -> C++ -> General<\/em> -> Additional Include Directories -> Edit<\/em>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c New Line (\u041d\u043e\u0432\u0443\u044e \u0421\u0442\u0440\u043e\u043a\u0443), \u0438\u0434\u0435\u043c \u0432<\/p>\n\n\n\n

    C:\\CPP\\p_windows<\/em><\/p>\n\n\n\n

    Select Folder, Ok, Apply, Ok<\/strong><\/p>\n\n\n\n


    \n\n\n\n

    4. \u041f\u043e\u0434 xPlatform<\/em> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c header file: Right-click \u043d\u0430 xPlatform<\/em>, Add -> New Item<\/em>,<\/p>\n\n\n\n

    • \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u201cHeader File (.h)\u201d<\/li>
    • name \u2013 platform.h<\/em><\/li>
    • Location \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439, \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043d\u0430 C:\\CPP\\p_windows<\/em><\/li><\/ul>\n\n\n\n

      \u0422\u0435\u043f\u0435\u0440\u044c \u2013 Add<\/strong>.<\/p>\n\n\n\n

      \u041a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043e \u0432\u044b\u0448\u0435, \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 – \u0432 \u043e\u043a\u043d\u0435 \u041a\u043e\u043d\u0441\u043e\u043b\u0438), \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 printf-\u0430.<\/p>\n\n\n\n

      \u041c\u044b \u041d\u0415 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c printf \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n\n\n\n

      • \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 PC. \u041d\u0430 Android-\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/li>
      • \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 OpenGL \u044d\u043a\u0440\u0430\u043d\u0435.<\/li>
      • \u041d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Debug \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0432 Release \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d.<\/li><\/ul>\n\n\n\n

        \u042d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u044f \u043d\u0430\u0437\u043e\u0432\u0443 mylog()<\/em>. \u0425\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a printf (\u0441\u043f\u0435\u0440\u0432\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0438 \u043f\u043e\u0442\u043e\u043c – \u043f\u043e \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u043c).<\/p>\n\n\n\n

        \u0415\u0449\u0435 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0432 Release \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041a\u043e\u0434:<\/p>\n\n\n

        \n#pragma once\n#include "stdio.h"\n#include <stdarg.h>\n\ninline void mylog(const char* _Format, ...) {\n#ifdef _DEBUG\n    va_list _ArgList;\n    va_start(_ArgList, _Format);\n    vprintf(_Format, _ArgList);\n    va_end(_ArgList);\n#endif\n};\n\n<\/pre><\/div>\n\n\n

        <\/p>\n\n\n\n

        \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0435\u0435 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c. <\/p>\n\n\n\n


        \n\n\n\n

        5. \u041e\u0442\u043a\u0440\u043e\u0435\u043c main.cpp<\/em>.<\/p>\n\n\n\n

        \u0421\u0432\u0435\u0440\u0445\u0443, \u0433\u0434\u0435 \u0438\u043d\u043a\u043b\u044e\u0434\u044b, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n\n\n\n

        #include \"platform.h\"<\/code><\/pre>\n\n\n\n

        \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main(void)<\/em>, \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u201c{\u201c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n\n\n\n

        mylog(\" Hello %s !\\n\", \"Windows\");<\/code><\/pre>\n\n\n\n

        \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c Debug <\/strong>\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e (\u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e).<\/p>\n\n\n\n

        \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c (\u0437\u0435\u043b\u0435\u043d\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u043a\u0430). \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043a\u043d\u043e \u041a\u043e\u043d\u0441\u043e\u043b\u0438:<\/p>\n\n\n\n

        Hello Windows !<\/strong><\/p>\n\n\n\n


        \n\n\n\n

        6. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u201c#include <stdio.h>\u201d \u0438\u0437 main.cpp<\/em> \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c error_callback()<\/em> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f printf \u043d\u0430 mylog <\/em>(\u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 printf-\u0430 \u0432 main.cpp<\/em>):<\/p>\n\n\n

        \nstatic void error_callback(int error, const char* description)\n{\n    mylog("Error: %s\\n", description);\n}\n\n<\/pre><\/div>\n\n\n

        <\/p>\n\n\n\n

        \u0415\u0449\u0435 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c – \u043d\u043e\u0440\u043c.<\/p>\n\n\n\n


        \n\n\n\n

        \u0422\u0435\u043f\u0435\u0440\u044c <\/p>\n\n\n\n

        Android:<\/h2>\n\n\n\n

        \u041d\u0430 Android-\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0433\u0434\u0430 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u2013 \u043d\u0435\u0442 \u043e\u043a\u043d\u0430 \u041a\u043e\u043d\u0441\u043e\u043b\u0438. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u2013 \u043d\u0435\u0442 \u201c\u043e\u043a\u043e\u043d\u201d \u0432\u043e\u043e\u0431\u0449\u0435 (\u0432 Windows-\u043e\u0432\u0441\u043a\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435). \u0417\u0430\u0442\u043e \u0435\u0441\u0442\u044c \u201cLogCat\u201d – \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Android-\u043e\u0432\u0441\u043a\u0438\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 debug\/development \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n\n\n\n

        7. \u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0438 \u043f\u0435\u0440\u0435-\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Visual Studio, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a999hello\\p_android\\p_android.sln<\/em>.<\/p>\n\n\n\n


        \n\n\n\n

        8. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c filter (virtual folder): right-click \u043d\u0430 p_android.NativeActivity<\/em> project -> Add -> New Filter<\/strong><\/em>.<\/p>\n\n\n\n

        \u0418\u043c\u044f \u0442\u043e \u0436\u0435, xPlatform<\/strong><\/p>\n\n\n\n


        \n\n\n\n

        9. \u041f\u043e\u0434 xPlatform <\/em>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c header file: Right-click \u043d\u0430 xPlatform<\/em>, Add -> New Item<\/em>,<\/p>\n\n\n\n

        • \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u201cHeader File (.h)\u201d<\/li>
        • name \u2013 platform.h<\/em><\/li>
        • \u041c\u0435\u043d\u044f\u0435\u043c location \u043d\u0430 C:\\CPP\\p_android\\<\/em><\/li><\/ul>\n\n\n\n

          \u0417\u0430\u0442\u0435\u043c \u2013 Add<\/strong>.<\/p>\n\n\n\n

          \u041a\u043e\u0434:<\/p>\n\n\n

          \n#pragma once\n#include <android\/log.h>\n#include "stdio.h"\n\ninline void mylog(const char* _Format, ...) {\n#ifdef _DEBUG\n    char outStr[1024];\n    va_list _ArgList;\n    va_start(_ArgList, _Format);\n    vsprintf(outStr, _Format, _ArgList);\n    __android_log_print(ANDROID_LOG_INFO, "mylog", outStr, NULL);\n    va_end(_ArgList);\n#endif\n};\n\n<\/pre><\/div>\n\n\n

          <\/p>\n\n\n\n

          \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 _DEBUG<\/strong>, \u043d\u043e \u043e\u043d\u0430 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u0432 Android’s debug \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n\n\n\n


          \n\n\n\n

          10. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c p_android.NativeApplication<\/em> project properties, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Debug <\/strong>configuration, ARM64,<\/em> <\/p>\n\n\n\n

          \u0418\u0434\u0435\u043c \u0432 Configuration Properties -> C\/C++ -> Preprocessor<\/em>, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Preprocessor Definitions -> Edit<\/em>. \u0415\u0441\u043b\u0438 _DEBUG<\/strong> \u0442\u0430\u043c \u043d\u0435\u0442, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0437\u0430\u0442\u0435\u043c OK, Apply, Ok.<\/p>\n\n\n\n


          \n\n\n\n

          11. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u043e\u0435\u043c main.cpp<\/em>.<\/p>\n\n\n\n

          \u0412 #include \u0441\u0435\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n\n\n\n

          #include \"platform.h\"<\/code><\/pre>\n\n\n\n

          \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 android_main (\u2026)<\/em>, \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u201c{\u201c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n\n\n\n

          mylog(\" Hello %s ! \\n\", \"Android\");<\/code><\/pre>\n\n\n\n

          <\/p>\n\n\n\n


          \n\n\n\n

          12. \u041e\u043f\u044f\u0442\u044c-\u0436\u0435, \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c p_android.NativeActivity<\/em> \u043f\u0440\u043e\u0435\u043a\u0442 \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e\u0442 platform.h<\/em>.<\/p>\n\n\n\n

          Right-click \u043d\u0430 p_android.NativeActivity<\/em> project -> Properties, All Configurations<\/strong>, ARM64<\/em>. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Configuration Properties -> C\/C++ -> General -> Additional Include Directories -> Edit<\/em>, \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u0434\u0435\u043c \u043d\u0430<\/p>\n\n\n\n

          C:\\CPP\\p_android<\/em><\/p>\n\n\n\n

          Select Folder, Ok, Apply, Ok.<\/p>\n\n\n\n


          \n\n\n\n

          13. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c <\/strong>\u043d\u0430\u0448 Android, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a PC USB \u043a\u0430\u0431\u0435\u043b\u0435\u043c, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c USB Debugging.<\/p>\n\n\n\n


          \n\n\n\n

          14. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a (\u0437\u0435\u043b\u0435\u043d\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u043a\u0430). \u041d\u0430 Android-\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e, \u0442\u043e\u0442 \u0436\u0435 \u043c\u0438\u0433\u0430\u044e\u0449\u0438\u0439 \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c LogCat<\/strong>.<\/p>\n\n\n\n


          \n\n\n\n

          15. \u041d\u0430 VS \u044d\u043a\u0440\u0430\u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043c\u0435\u043d\u044e -> Tools -> Android Tools -> Logcat<\/em>.<\/p>\n\n\n\n

          \u0412 \u043f\u043e\u043b\u0435 <Search Logcat> \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u201cmylog\u201d, Enter. \u0418 \u0447\u0442\u043e \u0442\u0430\u043c \u0443 \u043d\u0430\u0441?:<\/p>\n\n\n\n

          Hello Android !<\/strong><\/p>\n\n\n\n


          \n\n\n\n

          <\/p>\n","protected":false},"excerpt":{"rendered":"

          \u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u043c\u0435\u044f 2 OpenGL ES \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0438\u043d\u0443\u0442\u044c \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u043e\u0431\u0449\u0435\u0433\u043e \u0438 \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430. \u041e\u0431\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 GL context-\u0430, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0441 \u043f\u043e\u043a\u0430\u0434\u0440\u043e\u0432\u044b\u043c rendering-\u043e\u043c, \u0432\u044b\u0445\u043e\u0434. GL \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0421\u043b\u0430\u0432\u0430 \u0411\u043e\u0433\u0443!) \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u043e\u0436\u0435 \u043f\u043e\u0445\u043e\u0436\u0435. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043a\u043d\u0430 \u0438 GL-a, \u0432 GL-related \u0438\u043d\u043a\u043b\u044e\u0434\u0430\u0445 (gl\/egl \u043d\u0430 Android-\u0435 \u0438 glfw\/glad \u0432 Windows-\u0435). […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-cross-platform-3d"],"_links":{"self":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/comments?post=335"}],"version-history":[{"count":12,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/335\/revisions"}],"predecessor-version":[{"id":1130,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/335\/revisions\/1130"}],"wp:attachment":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/media?parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/categories?post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/tags?post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}