{"id":982,"date":"2017-03-29T06:01:53","date_gmt":"2017-03-29T06:01:53","guid":{"rendered":"http:\/\/demensdeum.com\/blog\/?p=982"},"modified":"2024-12-16T22:32:48","modified_gmt":"2024-12-16T19:32:48","slug":"porting-sdl-c-game-to-html5-emscripten","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ja\/2017\/03\/29\/porting-sdl-c-game-to-html5-emscripten\/","title":{"rendered":"Porting SDL C++ Game to HTML5 (Emscripten)"},"content":{"rendered":"<p><a href=\"https:\/\/translate.google.com\/translate?sl=ru&amp;tl=en&amp;js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fdemensdeum.com%2Fblog%2F2017%2F03%2F29%2Fporting-sdl-c-game-to-html5-emscripten%2F\" target=\"_blank\" rel=\"noopener\">[Translation may be some day]<\/a><\/p>\n<p><em>\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a <a href=\"https:\/\/github.com\/demensdeum\/FlameSteelEngine\" target=\"_blank\" rel=\"noopener\">Flame Steel Engine<\/a> \u0438 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <a href=\"https:\/\/github.com\/demensdeum\/FlameSteelEngineGameToolkit\" target=\"_blank\" rel=\"noopener\">Flame Steel Engine Game Toolkit<\/a>. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0438 <strong>SDL<\/strong> \u0438\u0433\u0440\u044b <a href=\"http:\/\/demensdeum.com\/games\/BadRobots\/BadRobots.html\" target=\"_blank\" rel=\"noopener\">Bad Robots<\/a> \u043d\u0430 <strong>HTML 5<\/strong>, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 <strong>Emscripten<\/strong>.<\/em><\/p>\n<h6>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Hello World &#8211; Emscripten<\/h6>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Emscripten. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 emsdk \u0434\u043b\u044f Linux. \u041d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a &#8220;<a class=\"reference external\" href=\"https:\/\/s3.amazonaws.com\/mozilla-games\/emscripten\/releases\/emsdk-portable.tar.gz\" target=\"_blank\" rel=\"noopener\">Portable Emscripten SDK for Linux and OS X<\/a>&#8220;. \u0412\u043d\u0443\u0442\u0440\u0438 \u0430\u0440\u0445\u0438\u0432\u0430 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u042f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e ~\/emsdk\/emsdk_portable.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 emscripten \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 hello_world.cpp \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0435\u0433\u043e \u0432 hello_world.html \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p>source ~\/emsdk\/emsdk_portable\/emsdk_env.sh<br \/>\nemcc hello_world.cpp -o hello_world.html<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f hello_world.html \u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>Firefox<\/strong>, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<h3>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0438\u0433\u0440\u044b<\/h3>\n<p>\u0412 <strong>javascript<\/strong> \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b &#8211; \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f &#8211; \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0448\u0430\u0433 \u0446\u0438\u043a\u043b\u0430 \u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 <strong>window.requestAnimationFrame(callback<\/strong>)<\/p>\n<p>\u0412 <strong>Emscripten<\/strong> \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u0431\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e <em>\u0440\u0435\u0448\u0435\u043d\u043e<\/em> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<p>emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infinite_loop);<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0438\u0433\u0440\u044b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 emscripten. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <strong>GLOBAL_fsegt_emscripten_gameLoop<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u044e \u0448\u0430\u0433 \u0446\u0438\u043a\u043b\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #557799;\">#ifdef __EMSCRIPTEN__<\/span>\r\n\r\n<span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">GLOBAL_fsegt_emscripten_gameLoop<\/span>() {\r\n\r\nGLOBAL_fsegt_emscripten_gameController<span style=\"color: #333333;\">-&gt;<\/span>gameLoop();\r\n\r\n}\r\n<span style=\"color: #557799;\">#endif<\/span>\r\n<\/pre>\n<\/div>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u043b\u044f Emscripten \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 __EMSCRIPTEN__.<\/p>\n<h3>\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p><strong>Emscripten<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043c\u0443\u0437\u044b\u043a\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <strong>data.<\/strong> \u0414\u0430\u043b\u0435\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435:<\/p>\n<p>emcc &lt;\u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438&gt; &#8211;use-preload-plugins &#8211;preload-file data<\/p>\n<p>\u0424\u043b\u0430\u0433 &#8211;use-preload-plugins \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u043f\u0440\u0435\u043b\u043e\u0430\u0434\u0435\u0440 \u0432 \u0443\u0433\u043b\u0443 \u044d\u043a\u0440\u0430\u043d\u0430, &#8211;preload-file \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u0444\u0430\u0439\u043b <strong>&lt;\u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430&gt;.data<br \/>\n<\/strong>\u041a\u043e\u0434 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u043f\u043e\u043a\u0430 \u044f \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u0444\u043b\u0430\u0433\u0430. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u043d\u0430 https (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 http) \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0430\u0449\u0438\u0442\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 \u0432\u0430\u0448\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u043b\u0430\u0433\u0438:<\/p>\n<p>-s TOTAL_MEMORY=67108864 -O3 -ffast-math<\/p>\n<p>TOTAL_MEMORY &#8211; \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0432 \u0431\u0430\u0439\u0442\u0430\u0445(?) \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0433\u0440\u044b. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<h3>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>\u041a\u043e\u0434 javascript \u0438\u0437 C++ \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0434\u0430\u0436\u0435 \u0441\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u043b\u044f HTML5, \u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c \u043a \u0440\u0443\u0447\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438\u0433\u0440\u044b, \u043f\u0430\u0440\u0430\u043b\u0435\u043b\u043b\u044c\u043d\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u0442\u0430\u043a\u0436\u0435 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e javascript \u043a\u043e\u0434\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043e\u0441\u043e\u0431\u043e \u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f javascript \u043a\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u043a\u0440\u043e\u0441 <a href=\"https:\/\/kripken.github.io\/emscripten-site\/docs\/porting\/connecting_cpp_and_javascript\/Interacting-with-code.html#interacting-with-code-call-javascript-from-native\" target=\"_blank\" rel=\"noopener\">EM_ASM<\/a>. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0439\u043a\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 emscripten, \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f fps \u0441 2-4 \u0434\u043e 30 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 canvas.drawImage, \u0432 \u043e\u0431\u0445\u043e\u0434 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 SDL-&gt;Canvas,<em> \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043f\u0440\u0438\u0440\u0430\u0432\u043d\u044f\u043b\u043e\u0441\u044c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e <strong>\u0432\u0441\u0435\u0433\u043e<\/strong> \u043d\u0430 javascript<\/em>.<\/p>\n<h3>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 SDL<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SDL_TTF, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u043b\u044f Game Score \u0432 <a href=\"http:\/\/demensdeum.com\/games\/BadRobots\/BadRobots.html\" target=\"_blank\" rel=\"noopener\">BadRobots<\/a> \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430. SDL_Image, SDL_Mixer \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0432 mixer \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u0443\u0437\u044b\u043a\u0438.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Flame Steel Engine, Flame Steel Engine Game Toolkit, \u0438\u0433\u0440\u044b Bad Robots:<\/p>\n<p><a href=\"https:\/\/github.com\/demensdeum\/BadRobots\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/demensdeum\/BadRobots<\/a><br \/>\n<a href=\"https:\/\/github.com\/demensdeum\/FlameSteelEngine\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/demensdeum\/FlameSteelEngine<\/a><br \/>\n<a href=\"https:\/\/github.com\/demensdeum\/FlameSteelEngineGameToolkit\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/demensdeum\/FlameSteelEngineGameToolkit<\/a><\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443:<\/p>\n<p><a href=\"https:\/\/hacks.mozilla.org\/2012\/04\/porting-me-my-shadow-to-the-web-c-to-javascriptcanvas-via-emscripten\/\" target=\"_blank\" rel=\"noopener\">https:\/\/hacks.mozilla.org\/2012\/04\/porting-me-my-shadow-to-the-web-c-to-javascriptcanvas-via-emscripten\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Translation may be some day] \u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0433\u043e\u0434 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0434\u0432\u0438\u0436\u043e\u043a Flame Steel Engine \u0438 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Flame Steel Engine Game Toolkit. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0438 SDL \u0438\u0433\u0440\u044b Bad Robots \u043d\u0430 HTML 5, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Emscripten. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Hello World &#8211; Emscripten \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/ja\/2017\/03\/29\/porting-sdl-c-game-to-html5-emscripten\/\">Continue reading <span class=\"screen-reader-text\">&#8220;Porting SDL C++ Game to HTML5 (Emscripten)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61,52],"tags":[],"class_list":["post-982","post","type-post","status-publish","format-standard","hentry","category-techie","category-tutorials","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ja","enabled_languages":["en","ru","zh","de","fr","ja","pt"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":false,"content":false,"excerpt":false},"de":{"title":false,"content":false,"excerpt":false},"fr":{"title":false,"content":false,"excerpt":false},"ja":{"title":false,"content":false,"excerpt":false},"pt":{"title":false,"content":false,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":29,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":1181,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/982\/revisions\/1181"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}