{"id":332306,"date":"2022-04-23T15:00:23","date_gmt":"2022-04-23T15:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332306"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332306","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0438\u0433\u0440\u0443 fly bird 2<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c91\/b4b\/a40\/c91b4ba40880a3325320a965fd49d377.gif\" width=\"2880\" height=\"1620\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c91\/b4b\/a40\/c91b4ba40880a3325320a965fd49d377.gif\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u0433\u0438\u0444\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u043f\u0442\u0438\u0447\u043a\u0438. \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0431\u043e\u0438\u0442\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u043b\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e. \u042f \u043e\u0431\u0449\u0430\u044f\u0441\u044c \u0441 \u043d\u0438\u043c \u043a\u0430\u043a \u0442\u043e \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f. \u0412 google play \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0430\u044f \u0438\u0433\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0434\u0435\u043b\u0430\u043b \u043d\u0430 unity, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0432\u0438\u0436\u043a\u043e\u043c.<\/p>\n<p><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.xverizex.fly_bird&amp;hl=ru&amp;gl=US\" rel=\"noopener noreferrer nofollow\">https:\/\/play.google.com\/store\/apps\/details?id=com.xverizex.fly_bird&amp;hl=ru&amp;gl=US<\/a><\/p>\n<p>\u0414\u0432\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043a \u0441\u0442\u0430\u0440\u043e\u0439 \u0438\u0433\u0440\u0435 \u0434\u0430\u043b\u0438 \u043c\u043d\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u043e \u0443\u0436\u0435 \u043d\u0430 C++ + SDL2 + OPENGL ES 3.2 + OPENSLES + glm. \u0422\u043e \u0435\u0441\u0442\u044c \u044f \u0434\u0430\u0436\u0435 \u0440\u0430\u0434 \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u0432\u0443\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043b\u044e\u0434\u044f\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0451 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u044b.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 sdl2, \u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435. \u041d\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0438\u0437\u0443\u0447\u0430\u044f \u043a\u043e\u0434, \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u044f \u0437\u043d\u0430\u044e (\u044f \u043f\u0440\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439), \u0435\u0441\u0442\u044c \u0435\u0449\u0451 mqueue. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u044f \u0434\u043e\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<pre><code class=\"cpp\">\/* SDL \u043f\u043e\u0442\u043e\u043a *\/ static int general_thread (void *p) {   SDL_Event ev;   while (SDL_WaitEvent (&amp;ev)) {     case SDL_MOUSEBUTTON_DOWN:     {       struct event *event = new struct event();       event->type = BUTTON_DOWN;       event->x = ev.x;  \/\/ \u0437\u0434\u0435\u0441\u044c \u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b \u043a\u043e\u0434, \u043f\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0434\u043e       event->y = ev.y;  \/\/ \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.       mq_send (mq, (const char *) &amp;event, sizeof (void *), 0);       break;     }   } }  int main (int argc, char **argv)  {   ...     game (); }  \/* \u0418 \u0433\u0434\u0435 \u0442\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f game *\/ void game () {   ...     mq_receive (mq, &amp;event, nullptr); }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043b\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 android ndk \u0435\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b mqueue.<\/p>\n<p>\u042f \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u0435\u0441\u0442\u044c \u043b\u0438 OpenAL \u0434\u043b\u044f android \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0438 \u043a\u0430\u043a \u043f\u043e\u0447\u0438\u0442\u0430\u043b \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f android \u043d\u0430 OpenSLES.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u0440\u0438\u0441\u0443\u043d\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0440\u043e, \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u0443\u0440 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<pre><code class=\"cpp\">static void gen_vao_vbo (Link *link) {         static float v[18] = {                 -0.5f, -0.5f, 0.0f,                 -0.5f, 0.5f, 0.0f,                 0.5f, -0.5f, 0.0f,                 0.5f, -0.5f, 0.0f,                 0.5f, 0.5f, 0.0f,                 -0.5f, 0.5f, 0.0f         };  #if 0         static float t[12] = {                 0.0f, 1.0f,                 0.0f, 0.0f,                 1.0f, 1.0f,                 1.0f, 1.0f,                 1.0f, 0.0f,                 0.0f, 0.0f         }; #else         static float t[12] = {                 0.0f, 0.0f,                 0.0f, 1.0f,                 1.0f, 0.0f,                 1.0f, 0.0f,                 1.0f, 1.0f,                 0.0f, 1.0f         }; #endif <\/code><\/pre>\n<p>\u042f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e \u0432 unity \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0438 \u0438\u0441\u0445\u043e\u0434\u0438\u043b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b \u044d\u043a\u0440\u0430\u043d \u043a\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">ortho = glm::ortho (-1.0f * aspect, 1 * aspect, 1.0f, -1.0f, 0.1f, 10.0f);<\/code><\/pre>\n<p>\u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u0431\u044b\u043b \u043a\u043e\u0434.<\/p>\n<p>\u041f\u043e\u0437\u0436\u0435 \u044f \u043f\u043e\u043d\u044f\u043b \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0440\u0435\u0448\u0438\u043b \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442 \u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">ortho = glm::ortho (0.0f, 2.0f * aspect * aspect, 2.0f, 0.0f, 0.1f, 10.0f);<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u0442\u043e \u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u043b\u0430\u044e \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">Sprite::Sprite (Common &amp;com) {         aspect = (float) com.screen_width \/ (float) com.screen_height;         screen_width = com.screen_width;         screen_height = com.screen_height;         ortho = glm::ortho (0.0f, 2.0f * aspect * aspect, 2.0f, 0.0f, 0.1f, 10.0f);         \/\/ortho = glm::ortho (0.0f, (float) com.screen_width, (float) com.screen_height, 0.0f, 0.1f, 10.0f);         pos = glm::translate (glm::mat4 (1.0f), glm::vec3 (0.0f, 0.0f, 0.0f));          program = get_shader (SHADER_MAIN);         glUseProgram (program);          uniform_cam = glGetUniformLocation (program, \"cam\");         uniform_pos = glGetUniformLocation (program, \"pos\");         uniform_ortho = glGetUniformLocation (program, \"ortho\");         uniform_tex = glGetUniformLocation (program, \"s_texture\");          cur_tex = 0;         play = -1; }<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u043a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0447\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e \u0437\u043b\u043e, \u0442\u043e \u044f \u0434\u0443\u043c\u0430\u044e \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u043e \u043e\u0442 \u043a\u043e\u0433\u043e \u0442\u043e \u0443\u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0438 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u043c\u043d\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Common \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041b\u0443\u0447\u0448\u0435 \u0431\u044b \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e extern \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0431\u044b \u0447\u0438\u0449\u0435. \u0414\u0430 \u0438 \u0435\u0449\u0451 \u044f \u043f\u043e \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043f\u0440\u0430\u0439\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e glGetUniformLocation \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a \u0448\u0435\u0439\u0434\u0435\u0440\u0443 \u0438\u043b\u0438 \u0447\u0442\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u0430 \u0438 \u043a\u043b\u0430\u0441\u0441 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0442\u044b \u0441\u043c\u0435\u043d\u0438\u043b \u0448\u0435\u0439\u0434\u0435\u0440. \u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u044f \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u043d\u043e \u044f \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u044e \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0415\u0449\u0435 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0421\u043f\u0440\u0430\u0439\u0442\u044b \u0431\u044b\u043b\u0438, \u043e\u0434\u043d\u0438 \u043a\u043e\u0440\u043e\u0447\u0435, \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u0435\u0435. \u041d\u043e \u044f \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<\/p>\n<pre><code class=\"cpp\">as = (float) com.screen_width \/ (float) com.screen_height;  \/* \u0435\u0441\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 *\/ float aspect = w \/ h;  w = 0.42f; h = w \/ aspect \/ as;  \/* \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 *\/ aspect = h \/ w;  h = 0.8f; w = h * aspect;<\/code><\/pre>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code class=\"cpp\">#pragma once  #define TO_STRING_FILENAME(name) name##_STRING   enum TO_DOWNLOADS {         LINK_BIRD,         LINK_INTRO,         LINK_BLOCK,         LINK_FLY_BIRD,         LINK_END_GAME,         LINK_LOGO,         LINKS_N };  #ifdef __ANDROID__ #define LINK_BIRD_STRING                  \"bird.res\" #define LINK_INTRO_STRING                 \"intro.res\" #define LINK_BLOCK_STRING                 \"block.res\" #define LINK_FLY_BIRD_STRING              \"fly_bird.res\" #define LINK_END_GAME_STRING              \"end_game.res\" #define LINK_LOGO_STRING                  \"logo.res\" #else #define LINK_BIRD_STRING                  \"assets\/bird.res\" #define LINK_INTRO_STRING                 \"assets\/intro.res\" #define LINK_BLOCK_STRING                 \"assets\/block.res\" #define LINK_FLY_BIRD_STRING              \"assets\/fly_bird.res\" #define LINK_END_GAME_STRING              \"assets\/end_game.res\" #define LINK_LOGO_STRING                  \"assets\/logo.res\" #endif <\/code><\/pre>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0441\u044b\u043b\u043a\u0443, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d.<\/p>\n<pre><code class=\"cpp\">Link *downloader_load (const enum TO_DOWNLOADS file) {         switch (file) {                 case LINK_BIRD:                         if (link[LINK_BIRD] == nullptr)                                 link[LINK_BIRD] = load_link (TO_STRING_FILENAME (LINK_BIRD));                         break;                 case LINK_INTRO:                         if (link[LINK_INTRO] == nullptr)                                 link[LINK_INTRO] = load_link (TO_STRING_FILENAME (LINK_INTRO));                         break;                 case LINK_BLOCK:                         if (link[LINK_BLOCK] == nullptr)                                 link[LINK_BLOCK] = load_link (TO_STRING_FILENAME (LINK_BLOCK));                         break;                 case LINK_FLY_BIRD:                         if (link[LINK_FLY_BIRD] == nullptr)                                 link[LINK_FLY_BIRD] = load_link (TO_STRING_FILENAME (LINK_FLY_BIRD));                         break;                 case LINK_END_GAME:                         if (link[LINK_END_GAME] == nullptr)                                 link[LINK_END_GAME] = load_link (TO_STRING_FILENAME (LINK_END_GAME));                         break;                 case LINK_LOGO:                         if (link[LINK_LOGO] == nullptr)                                 link[LINK_LOGO] = load_link (TO_STRING_FILENAME (LINK_LOGO));                         break;         }          return link[file]; }<\/code><\/pre>\n<p>\u0414\u0430, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u043a\u0441\u0442\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c, \u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u0438 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u0412 link \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u0435 vao, vbo[2] \u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u043a\u0441\u0442\u0443\u0440.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0438\u0433\u0440\u044b \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u043d\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043e \u0434\u0432\u0435 \u043f\u0442\u0438\u0446\u044b. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u044f \u043e\u0442\u0440\u0430\u0436\u0430\u044e \u0441\u043f\u0440\u0430\u0439\u0442 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u0440\u0438\u0441\u0443\u044e \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u044d\u043a\u0440\u0430\u043d\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u044f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0434.<\/p>\n<pre><code class=\"cpp\">void Sprite::mirror_right () {         glBindVertexArray (link->vao);         glBindBuffer (GL_ARRAY_BUFFER, link->vbo[0]);         float *b = (float *) glMapBufferRange (GL_ARRAY_BUFFER, 0, sizeof (float) * 18, GL_MAP_WRITE_BIT);          float ww = w;         float hh = h;          b[0] = 0;         b[1] = 0;         b[2] = 0;         b[3] = 0;         b[4] = hh;         b[5] = 0;         b[6] = ww;         b[7] = 0;         b[8] = 0;         b[9] = ww;         b[10] = 0;         b[11] = 0;         b[12] = ww;         b[13] = hh;         b[14] = 0;         b[15] = 0;         b[16] = hh;         b[17] = 0;          glUnmapBuffer (GL_ARRAY_BUFFER); }  void Sprite::mirror_left () {         glBindVertexArray (link->vao);         glBindBuffer (GL_ARRAY_BUFFER, link->vbo[0]);         float *b = (float *) glMapBufferRange (GL_ARRAY_BUFFER, 0, sizeof (float) * 18, GL_MAP_WRITE_BIT);          float ww = w;         float hh = h;          b[0] = ww;         b[1] = 0;         b[2] = 0;         b[3] = ww;         b[4] = hh;         b[5] = 0;         b[6] = 0;         b[7] = 0;         b[8] = 0;         b[9] = 0;         b[10] = 0;         b[11] = 0;         b[12] = 0;         b[13] = hh;         b[14] = 0;         b[15] = ww;         b[16] = hh;         b[17] = 0;          glUnmapBuffer (GL_ARRAY_BUFFER); } <\/code><\/pre>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043c\u0435\u043d\u044f\u0432 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b.<\/p>\n<p>\u041f\u043e OpenAL \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u0443\u0437\u044b\u043a\u0443 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f 44100 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438 16 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u0432\u0440\u043e\u0434\u0435. \u041f\u043e OpenSLES \u044f \u0441\u043a\u0430\u0447\u0430\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0447\u0438\u0442\u0430\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b \u043a\u043e\u0434, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043d\u0430 android.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 android \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u043d\u0435\u0442 mqueue \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u042f \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u043b\u044c\u043a\u043e syscall \u043e\u0442 \u044f\u0434\u0440\u0430 linux. \u041d\u043e \u0435\u0441\u043b\u0438 \u0431\u044b\u043b syscall \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f mq_open, \u0442\u043e syscall \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u043a\u0430\u043a \u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430 C \u043f\u0438\u0441\u0430\u043b \u0438 \u043d\u0430 C++ \u043e\u043f\u044b\u0442\u0430 \u043c\u0430\u043b\u043e, \u0442\u043e \u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0432 C++ \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 queue. \u0418 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043f\u0430\u0441\u0435\u043d\u0438\u0435\u043c, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0435\u0451 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u044f\u0434\u043e\u043c \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 main \u0438 sdl \u043f\u043e\u0442\u043e\u043a\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0432 \u043d\u0435\u0435 event. \u0410 \u0432 game () \u0444\u0430\u0439\u043b\u0435 \u044f \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u043b queue \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e extern \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u0418 \u0432\u0443\u0430\u043b\u044f, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b, \u0442\u043e \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0440\u0435\u0441\u0443\u0440\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0447\u0438\u0441\u043b\u043e 1. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043e\u043d\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0435, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043c\u0435\u043d\u0443 \u0438\u0437 littleEngian \u0432 bigEngian.<\/p>\n<pre><code class=\"cpp\">static int swap_little_big_engian (int num) {         return (((num >> 24) &amp; 0xff) | ((num &lt;&lt; 8) &amp; 0xff0000) | ((num >> 8) &amp; 0xff00) | ((num &lt;&lt; 24) &amp; 0xff000000)); }  static uint8_t **diff_file_to_textures (Link *link, const char *filename) {         int lb = 0;          SDL_RWops *io = SDL_RWFromFile (filename, \"rb\");         SDL_RWseek (io, 0, RW_SEEK_END);         long pos = SDL_RWtell (io);         SDL_RWseek (io, 0, RW_SEEK_SET);         uint8_t *file = new uint8_t[pos];         SDL_RWread (io, file, pos, 1);         SDL_RWclose (io);          const int LTBE = 0;         const int COUNT = 1;         const int WIDTH = 2;         const int HEIGHT = 3;         int *pack[4];          for (int i = 0; i &lt; 4; i++) {                 pack[i] = (int *) &amp;file[i * 4];         }          if (*pack[LTBE] != 1) {                 for (int i = 1; i &lt; 4; i++) {                         *pack[i] = swap_little_big_engian (*pack[i]);                 }         }          link->size_tex = *pack[COUNT];         link->width = *pack[WIDTH];         link->height = *pack[HEIGHT]; ...<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0447\u0435\u0442 \u0448\u0440\u0438\u0444\u0442\u0430 freetype2. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0442\u0430\u0440\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 freetype, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 github, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u043e\u0432\u0443\u044e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0441\u043c\u043e\u0433 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f android.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 OpenGLESv3, \u043d\u0430\u0434\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432 ndk \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0435\u0441\u0442\u044c \u043d\u0435 \u043d\u0438\u0436\u0435 18 api. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439, \u043d\u0443\u0436\u043d\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 app \u0432 \u0444\u0430\u0439\u043b\u0435 build.gradle \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0438\u043f\u0430 \u0442\u0430\u043a\u043e\u0433\u043e.<\/p>\n<pre><code class=\"cpp\">android {     compileSdkVersion 31     defaultConfig {         if (buildAsApplication) {             applicationId \"com.xverizex.fly_bird_2\"         }         minSdkVersion 18         targetSdkVersion 31           ...                       ndkBuild {                 arguments \"APP_PLATFORM=android-18\"                 abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'             } <\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u0432 ndkBuild \u0442\u043e\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041d\u0443 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 app\/jni\/Application.mk \u0432\u0435\u0440\u0441\u0438\u044e api \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c.<\/p>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u043e\u043f\u044b\u0442, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0433\u0440\u0443 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0431\u043b\u0438\u043a, \u0430 \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0434\u0438\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438 \u043d\u0430\u0437\u0432\u0430\u043b &#8212; \u0438\u0433\u0440\u044b \u043e\u0442 xverizex. <\/p>\n<p><a href=\"https:\/\/vk.com\/xverizex_games\" rel=\"noopener noreferrer nofollow\">https:\/\/vk.com\/xverizex_games<\/a><\/p>\n<p>\u0418\u0433\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u043a\u043e\u0434\u043e\u0432\u043e\u043c\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0432 google play.<\/p>\n<p>com.xverizex.fly_bird_2<\/p>\n<p>\u041f\u0440\u0430\u0432\u0434\u0430 \u044f \u0432\u0441\u0451 \u0435\u0449\u0451 \u0436\u0434\u0443 \u043f\u043e\u043a\u0430 \u043e\u0434\u043e\u0431\u0440\u044f\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u043f\u043e\u043a\u0430 \u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u0435. \u042f \u0445\u043e\u0447\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432 google play, \u0430 \u0432 huawei \u043c\u0430\u0440\u043a\u0435\u0442\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0446\u0435\u043d\u0443 \u043d\u0430 \u0438\u0433\u0440\u0443. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0435\u0449\u0451 \u0437\u0430\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u043c \u0447\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0418\u0433\u0440\u0430 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0451 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430 5 \u0434\u043d\u0435\u0439. \u0414\u0430, \u043d\u0430 unity \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430 \u0434\u043d\u044f \u0434\u0432\u0430 \u0438\u043b\u0438 \u043e\u0434\u0438\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f C \u0438 C++, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u044f \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0442\u043e\u043c \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f. <\/p>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u0438 \u043c\u043e\u0438 \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b \u0437\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u043f\u044f\u0442\u044c \u0434\u043d\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u042f \u043f\u0438\u0441\u0430\u043b \u043f\u043e 12 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u043e\u0432 \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0438 \u043d\u0435 \u043c\u043e\u0433 \u0443\u0441\u043d\u0443\u0442\u044c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u043e\u0445\u043d\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u0445\u043e\u0434\u043e\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432 \u044d\u0442\u043e\u0439 \u0438\u0433\u0440\u0435 \u0438\u043b\u0438 \u043d\u043e\u0432\u0430\u044f \u0438\u0433\u0440\u0430. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><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\/ru\/post\/662559\/\"> https:\/\/habr.com\/ru\/post\/662559\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u0433\u0438\u0444\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u043f\u0442\u0438\u0447\u043a\u0438. \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0431\u043e\u0438\u0442\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043e\u0431\u0443\u0447\u0430\u043b\u0441\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e. \u042f \u043e\u0431\u0449\u0430\u044f\u0441\u044c \u0441 \u043d\u0438\u043c \u043a\u0430\u043a \u0442\u043e \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f. \u0412 google play \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0430\u044f \u0438\u0433\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0434\u0435\u043b\u0430\u043b \u043d\u0430 unity, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0432\u0438\u0436\u043a\u043e\u043c.<\/p>\n<p><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.xverizex.fly_bird&amp;hl=ru&amp;gl=US\" rel=\"noopener noreferrer nofollow\">https:\/\/play.google.com\/store\/apps\/details?id=com.xverizex.fly_bird&amp;hl=ru&amp;gl=US<\/a><\/p>\n<p>\u0414\u0432\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043a \u0441\u0442\u0430\u0440\u043e\u0439 \u0438\u0433\u0440\u0435 \u0434\u0430\u043b\u0438 \u043c\u043d\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043d\u043e \u0443\u0436\u0435 \u043d\u0430 C++ + SDL2 + OPENGL ES 3.2 + OPENSLES + glm. \u0422\u043e \u0435\u0441\u0442\u044c \u044f \u0434\u0430\u0436\u0435 \u0440\u0430\u0434 \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u0432\u0443\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043b\u044e\u0434\u044f\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0451 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u043e, \u0447\u0442\u043e\u0431\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u044b.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0433\u0440\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 sdl2, \u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u044f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435. \u041d\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0438\u0437\u0443\u0447\u0430\u044f \u043a\u043e\u0434, \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u044f \u0437\u043d\u0430\u044e (\u044f \u043f\u0440\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439), \u0435\u0441\u0442\u044c \u0435\u0449\u0451 mqueue. \u0418 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u044f \u0434\u043e\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<pre><code class=\"cpp\">\/* SDL \u043f\u043e\u0442\u043e\u043a *\/ static int general_thread (void *p) {   SDL_Event ev;   while (SDL_WaitEvent (&amp;ev)) {     case SDL_MOUSEBUTTON_DOWN:     {       struct event *event = new struct event();       event->type = BUTTON_DOWN;       event->x = ev.x;  \/\/ \u0437\u0434\u0435\u0441\u044c \u044f \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b \u043a\u043e\u0434, \u043f\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0434\u043e       event->y = ev.y;  \/\/ \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.       mq_send (mq, (const char *) &amp;event, sizeof (void *), 0);       break;     }   } }  int main (int argc, char **argv)  {   ...     game (); }  \/* \u0418 \u0433\u0434\u0435 \u0442\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f game *\/ void game () {   ...     mq_receive (mq, &amp;event, nullptr); }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043b\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 android ndk \u0435\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b mqueue.<\/p>\n<p>\u042f \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u0435\u0441\u0442\u044c \u043b\u0438 OpenAL \u0434\u043b\u044f android \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0438 \u043a\u0430\u043a \u043f\u043e\u0447\u0438\u0442\u0430\u043b \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043b\u044f android \u043d\u0430 OpenSLES.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u0440\u0438\u0441\u0443\u043d\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0440\u043e, \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0442\u0435\u043a\u0441\u0442\u0443\u0440 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u043d\u044b\u0445 \u0431\u0443\u0444\u0435\u0440\u043e\u0432. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u0435\u0440\u0448\u0438\u043d.<\/p>\n<pre><code class=\"cpp\">static void gen_vao_vbo (Link *link) {         static float v[18] = {                 -0.5f, -0.5f, 0.0f,                 -0.5f, 0.5f, 0.0f,                 0.5f, -0.5f, 0.0f,                 0.5f, -0.5f, 0.0f,                 0.5f, 0.5f, 0.0f,                 -0.5f, 0.5f, 0.0f         };  #if 0         static float t[12] = {                 0.0f, 1.0f,                 0.0f, 0.0f,                 1.0f, 1.0f,                 1.0f, 1.0f,                 1.0f, 0.0f,                 0.0f, 0.0f         }; #else         static float t[12] = {                 0.0f, 0.0f,                 0.0f, 1.0f,                 1.0f, 0.0f,                 1.0f, 0.0f,                 1.0f, 1.0f,                 0.0f, 1.0f         }; #endif <\/code><\/pre>\n<p>\u042f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e \u0432 unity \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0438 \u0438\u0441\u0445\u043e\u0434\u0438\u043b \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b \u044d\u043a\u0440\u0430\u043d \u043a\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">ortho = glm::ortho (-1.0f * aspect, 1 * aspect, 1.0f, -1.0f, 0.1f, 10.0f);<\/code><\/pre>\n<p>\u0432\u0440\u043e\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u0431\u044b\u043b \u043a\u043e\u0434.<\/p>\n<p>\u041f\u043e\u0437\u0436\u0435 \u044f \u043f\u043e\u043d\u044f\u043b \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0440\u0435\u0448\u0438\u043b \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442 \u043b\u0435\u0432\u043e\u0433\u043e \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">ortho = glm::ortho (0.0f, 2.0f * aspect * aspect, 2.0f, 0.0f, 0.1f, 10.0f);<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u0442\u043e \u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0434\u0435\u043b\u0430\u044e \u043e\u0448\u0438\u0431\u043a\u0438 \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"cpp\">Sprite::Sprite (Common &amp;com) {         aspect = (float) com.screen_width \/ (float) com.screen_height;         screen_width = com.screen_width;         screen_height = com.screen_height;         ortho = glm::ortho (0.0f, 2.0f * aspect * aspect, 2.0f, 0.0f, 0.1f, 10.0f);         \/\/ortho = glm::ortho (0.0f, (float) com.screen_width, (float) com.screen_height, 0.0f, 0.1f, 10.0f);         pos = glm::translate (glm::mat4 (1.0f), glm::vec3 (0.0f, 0.0f, 0.0f));          program = get_shader (SHADER_MAIN);         glUseProgram (program);          uniform_cam = glGetUniformLocation (program, \"cam\");         uniform_pos = glGetUniformLocation (program, \"pos\");         uniform_ortho = glGetUniformLocation (program, \"ortho\");         uniform_tex = glGetUniformLocation (program, \"s_texture\");          cur_tex = 0;         play = -1; }<\/code><\/pre>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u043a\u043e\u0433\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0447\u0442\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e \u0437\u043b\u043e, \u0442\u043e \u044f \u0434\u0443\u043c\u0430\u044e \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u043e \u043e\u0442 \u043a\u043e\u0433\u043e \u0442\u043e \u0443\u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u0438 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u043c\u043d\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Common \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041b\u0443\u0447\u0448\u0435 \u0431\u044b \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e extern \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0431\u044b \u0447\u0438\u0449\u0435. \u0414\u0430 \u0438 \u0435\u0449\u0451 \u044f \u043f\u043e \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043f\u0440\u0430\u0439\u0442 \u0437\u0430\u043d\u043e\u0432\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e glGetUniformLocation \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u0448\u0435\u0439\u0434\u0435\u0440\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a \u0448\u0435\u0439\u0434\u0435\u0440\u0443 \u0438\u043b\u0438 \u0447\u0442\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u0430 \u0438 \u043a\u043b\u0430\u0441\u0441 \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0442\u044b \u0441\u043c\u0435\u043d\u0438\u043b \u0448\u0435\u0439\u0434\u0435\u0440. \u0425\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u044f \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u043d\u043e \u044f \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u044e \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0415\u0449\u0435 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0421\u043f\u0440\u0430\u0439\u0442\u044b \u0431\u044b\u043b\u0438, \u043e\u0434\u043d\u0438 \u043a\u043e\u0440\u043e\u0447\u0435, \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u0435\u0435. \u041d\u043e \u044f \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u043e\u0431 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<\/p>\n<pre><code class=\"cpp\">as = (float) com.screen_width \/ (float) com.screen_height;  \/* \u0435\u0441\u043b\u0438 \u0448\u0438\u0440\u0438\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 *\/ float aspect = w \/ h;  w = 0.42f; h = w \/ aspect \/ as;  \/* \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 *\/ aspect = h \/ w;  h = 0.8f; w = h * aspect;<\/code><\/pre>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code class=\"cpp\">#pragma once  #define TO_STRING_FILENAME(name) name##_STRING   enum TO_DOWNLOADS {         LINK_BIRD,         LINK_INTRO,         LINK_BLOCK,         LINK_FLY_BIRD,         LINK_END_GAME,         LINK_LOGO,         LINKS_N };  #ifdef __ANDROID__ #define LINK_BIRD_STRING                  \"bird.res\" #define LINK_INTRO_STRING                 \"intro.res\" #define LINK_BLOCK_STRING                 \"block.res\" #define LINK_FLY_BIRD_STRING              \"fly_bird.res\" #define LINK_END_GAME_STRING              \"end_game.res\" #define LINK_LOGO_STRING                  \"logo.res\" #else #define LINK_BIRD_STRING                  \"assets\/bird.res\" #define LINK_INTRO_STRING                 \"assets\/intro.res\" #define LINK_BLOCK_STRING                 \"assets\/block.res\" #define LINK_FLY_BIRD_STRING              \"assets\/fly_bird.res\" #define LINK_END_GAME_STRING              \"assets\/end_game.res\" #define LINK_LOGO_STRING                  \"assets\/logo.res\" #endif <\/code><\/pre>\n<p>\u0418 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0441\u044b\u043b\u043a\u0443, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d.<\/p>\n<pre><code class=\"cpp\">Link *downloader_load (const enum TO_DOWNLOADS file) {         switch (file) {                 case LINK_BIRD:                         if (link[LINK_BIRD] == nullptr)                                 link[LINK_BIRD] = load_link (TO_STRING_FILENAME (LINK_BIRD));                         break;                 case LINK_INTRO:                         if (link[LINK_INTRO] == nullptr)                                 link[LINK_INTRO] = load_link (TO_STRING_FILENAME (LINK_INTRO));                         break;                 case LINK_BLOCK:                         if (link[LINK_BLOCK] == nullptr)                                 link[LINK_BLOCK] = load_link (TO_STRING_FILENAME (LINK_BLOCK));                         break;                 case LINK_FLY_BIRD:                         if (link[LINK_FLY_BIRD] == nullptr)                                 link[LINK_FLY_BIRD] = load_link (TO_STRING_FILENAME (LINK_FLY_BIRD));                         break;                 case LINK_END_GAME:                         if (link[LINK_END_GAME] == nullptr)                                 link[LINK_END_GAME] = load_link (TO_STRING_FILENAME (LINK_END_GAME));                         break;                 case LINK_LOGO:                         if (link[LINK_LOGO] == nullptr)                                 link[LINK_LOGO] = load_link (TO_STRING_FILENAME (LINK_LOGO));                         break;         }          return link[file]; }<\/code><\/pre>\n<p>\u0414\u0430, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u043a\u0441\u0442\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c, \u043d\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u0438 \u043d\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d. \u0412 link \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u0435 vao, vbo[2] \u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u043a\u0441\u0442\u0443\u0440.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0438\u0433\u0440\u044b \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u043d\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043e \u0434\u0432\u0435 \u043f\u0442\u0438\u0446\u044b. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u044f \u043e\u0442\u0440\u0430\u0436\u0430\u044e \u0441\u043f\u0440\u0430\u0439\u0442 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u0440\u0438\u0441\u0443\u044e \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u044d\u043a\u0440\u0430\u043d\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a \u044f \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0434.<\/p>\n<pre><code class=\"cpp\">void Sprite::mirror_right () {         glBindVertexArray (link->vao);         glBindBuffer (GL_ARRAY_BUFFER, link->vbo[0]);         float *b = (float *) glMapBufferRange (GL_ARRAY_BUFFER, 0, sizeof (float) * 18, GL_MAP_WRITE_BIT);          float ww = w;         float hh = h;          b[0] = 0;         b[1] = 0;         b[2] = 0;         b[3] = 0;         b[4] = hh;         b[5] = 0;         b[6] = ww;         b[7] = 0;         b[8] = 0;         b[9] = ww;         b[10] = 0;         b[11] = 0;         b[12] = ww;         b[13] = hh;         b[14] = 0;         b[15] = 0;         b[16] = hh;         b[17] = 0;          glUnmapBuffer (GL_ARRAY_BUFFER); }  void Sprite::mirror_left () {         glBindVertexArray (link->vao);         glBindBuffer (GL_ARRAY_BUFFER, link->vbo[0]);         float *b = (float *) glMapBufferRange (GL_ARRAY_BUFFER, 0, sizeof (float) * 18, GL_MAP_WRITE_BIT);          float ww = w;         float hh = h;          b[0] = ww;         b[1] = 0;         b[2] = 0;         b[3] = ww;         b[4] = hh;         b[5] = 0;         b[6] = 0;         b[7] = 0;         b[8] = 0;         b[9] = 0;         b[10] = 0;         b[11] = 0;         b[12] = 0;         b[13] = hh;         b[14] = 0;         b[15] = ww;         b[16] = hh;         b[17] = 0;          glUnmapBuffer (GL_ARRAY_BUFFER); } <\/code><\/pre>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-332306","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332306","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=332306"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332306\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}