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 61311. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c VS. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a998engine\\p_windows\\p_windows.sln<\/em><\/p>\n\n\n\n MyColor \u043a\u043b\u0430\u0441\u0441<\/strong><\/p>\n\n\n\n \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0432 \u0422\u0420\u0415\u0425 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445:<\/p>\n\n\n\n \u041b\u044e\u0431\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043b\u044e\u0431\u043e\u043c \u0438\u0437 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445.<\/p>\n\n\n\n 2. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header (.h) \u0444\u0430\u0439\u043b MyColor.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n 3. \u041e\u0442\u043a\u0440\u043e\u0435\u043c platform.h<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 4. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 C++ File (.cpp) MyColor.cpp<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n Material \u043a\u043b\u0430\u0441\u0441<\/strong><\/p>\n\n\n\n “Material” \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 – \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u041a\u0410\u041a \u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u043c, \u043a\u0430\u043a\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0443 \u0438\u043b\u0438 \u0446\u0432\u0435\u0442, \u0438 \u0442.\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, “\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0437\u0435\u043b\u0435\u043d\u0443\u044e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c ucolor_flat \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u043c” – \u044d\u0442\u043e \u043e\u0434\u0438\u043d Material. “\u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u043c \u0436\u0435 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u043c” – \u0443\u0436\u0435 \u0434\u0440\u0443\u0433\u043e\u0439. \u0427\u0422\u041e \u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c – \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441. \u041f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0447\u0442\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n\n\n\n 5. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header (.h) \u0444\u0430\u0439\u043b Material.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n 6. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 C++ (.cpp) \u0444\u0430\u0439\u043b Material.cpp<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n\n\n\n \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0427\u0422\u041e \u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043d\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0438 Material<\/em>, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u0427\u0422\u041e \u0440\u0435\u043d\u0434\u0440\u0438\u0442\u044c \u0438 \u041a\u0410\u041a. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e DrawJob<\/strong>.<\/p>\n\n\n\n \u041a\u0430\u0436\u0434\u044b\u0439 game subject \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c 1 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e DrawJobs<\/em>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u0438\u043c \u043c\u044b \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u043d\u0438\u0439 \u043a\u0443\u0431\u0438\u043a \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u0417\u043d\u0430\u0447\u0438\u0442, \u0443 subject-\u0430 \u0431\u0443\u0434\u0435\u0442 2 DrawJobs<\/em>:<\/p>\n\n\n\n \u041a\u043b\u0430\u0441\u0441 TheGame <\/em>\u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 game subject-\u043e\u0432 \u0438 \u0438\u0445 DrawJobs <\/em>\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c.<\/p>\n\n\n\n \u041a\u0430\u0436\u0434\u044b\u0439 DrawJob <\/em>\u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 – \u043d\u0430 \u043e\u0434\u0438\u043d vertex_buffer VBO (Vertex Buffer Object, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u0435\u0440\u0442\u0435\u043a\u0441\u043e\u0432). \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044d\u0442\u043e\u0433\u043e VBO \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 5 floats (\u0430 \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u0438 2 VBO: \u0432 \u043e\u0434\u043d\u043e\u043c xyz \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u043d\u044b\u0435 – tUV).<\/p>\n\n\n\n \u0422\u0430\u043a\u0436\u0435 DrawJob <\/em>\u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a aPos \u0438\u043b\u0438 aTuv) \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u0435\u0435 \u0438\u0441\u043a\u0430\u0442\u044c (\u0432 \u043a\u0430\u043a\u043e\u043c VBO \u0438 \u0435\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044e\/offset\/\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e VBO). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0435 AttribRef <\/em>(for Attribute Reference).<\/p>\n\n\n\n \u0421\u0430\u043c\u0438 VBO \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e (\u0432 GPU). \u0412 DrawJob \u0436\u0435 <\/em>(\u0432 AttribRefs, <\/em>\u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435) \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u043c\u0435\u0440 – VBO id.<\/p>\n\n\n\n DrawJob class<\/strong><\/p>\n\n\n\n 7. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 header (.h) \u0444\u0430\u0439\u043b DrawJob.h<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n 8. \u041f\u043e\u0434 xEngine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 C++ (.cpp) \u0444\u0430\u0439\u043b DrawJob.cpp<\/strong><\/p>\n\n\n\n Location – C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043f\u043e\u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 AttribRef <\/em>\u0438 \u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u043f\u043e\u043a\u0430 \u0442\u0440\u0443\u0434\u043d\u043e\u0432\u0430\u0442\u043e, \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.<\/p>\n\n\n\n 9. \u041e\u0442\u043a\u0440\u043e\u0435\u043c TheGame.cpp<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 10. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a – \u043e\u0442\u043b\u0438\u0447\u043d\u043e.<\/p>\n\n\n\n \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430<\/p>\n\n\n\n 11. \u041f\u0435\u0440\u0435-\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c VS. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a998engine\\p_android\\p_android.sln<\/em>.<\/p>\n\n\n\n 12. \u041f\u043e\u0434 xEndine <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c Existing<\/strong> Item<\/p>\n\n\n\n \u0418\u0434\u0435\u043c \u0432 C:\\CPP\\engine<\/em><\/p>\n\n\n\n \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c<\/p>\n\n\n\n Add<\/strong>.<\/p>\n\n\n\n \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c Android’s myUint32\/8<\/em> implementations.<\/p>\n\n\n\n 13. \u041e\u0442\u043a\u0440\u043e\u0435\u043c platform.h<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 14. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c, \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c<\/strong> \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Android, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c debugging.<\/p>\n\n\n\n \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a – \u043e\u0442\u043b\u0438\u0447\u043d\u043e.<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" Windows 1. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c VS. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a998engine\\p_windows\\p_windows.sln MyColor \u043a\u043b\u0430\u0441\u0441 \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0432 \u0422\u0420\u0415\u0425 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445: \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 4-\u0445 byte integers (\u043e\u0442 0 \u0434\u043e 255, \u043a\u0430\u043a \u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0430\u0445) \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 4-\u0445 floats (\u043e\u0442 0.0 \u0434\u043e 1.0, \u043a\u0430\u043a \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f OpenGL-\u043e\u043c) \u0438 \u043a\u0430\u043a 32-bit integer (4 \u0431\u0430\u0439\u0442\u0430, \u043f\u043e […]<\/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-507","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\/507","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=507"}],"version-history":[{"count":16,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"predecessor-version":[{"id":1657,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/507\/revisions\/1657"}],"wp:attachment":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\n\n\n\n#pragma once\n#include "platform.h"\n\nclass MyColor\n{\nprivate:\n float rgba[4] = { 0,0,0,0 };\n union {\n myUint32 uint32value = 0;\n myUint8 channel[4]; \/\/4 channels\n } RGBA;\npublic:\n float* forGL() { return rgba; };\n static void cloneIntToFloat(MyColor* pCl);\n static void cloneFloatToInt(MyColor* pCl);\n void setRGBA(float* rgba) { return setRGBA(this, rgba); };\n static void setRGBA(MyColor* pCl, float* rgba);\n void setRGBA(float r, float g, float b, float a) { return setRGBA(this, r, g, b, a); };\n static void setRGBA(MyColor* pCl, float r, float g, float b, float a);\n void setRGBA(int R, int G, int B, int A) { return setRGBA(this, R, G, B, A); };\n static void setRGBA(MyColor* pCl, int R, int G, int B, int A);\n void setRGBA(unsigned char* RGBA) { return setRGBA(this, RGBA); };\n static void setRGBA(MyColor* pCl, unsigned char* RGBA);\n void setUint32(unsigned int RGBA) { return setUint32(this, RGBA); };\n static void setUint32(MyColor* pCl, unsigned int RGBA);\n bool isZero() { return (RGBA.uint32value == 0); };\n bool isSet() { return (RGBA.uint32value != 0); };\n void clear() { setUint32(0); };\n unsigned int getUint32() { return (unsigned int)RGBA.uint32value; };\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include <glad\/glad.h>\n#include <stdio.h>\n\ntypedef unsigned _int64 myUint64;\ntypedef unsigned _int32 myUint32;\ntypedef unsigned _int16 myUint16;\ntypedef unsigned _int8 myUint8;\n\nvoid mylog(const char* _Format, ...);\nvoid mySwapBuffers();\nvoid myPollEvents();\nint myFopen_s(FILE** pFile, const char* filePath, const char* mode);\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "MyColor.h"\n\nfloat chanIntToFloat = 1.0f \/ 255;\n\nvoid MyColor::cloneIntToFloat(MyColor* pCl) {\n\tfor (int i = 0; i < 4; i++)\n\t\tpCl->rgba[i] = chanIntToFloat * pCl->RGBA.channel[i];\n}\nvoid MyColor::cloneFloatToInt(MyColor* pCl) {\n\tfor (int i = 0; i < 4; i++)\n\t\tpCl->RGBA.channel[i] = (int)(pCl->rgba[i] * 255);\n}\nvoid MyColor::setRGBA(MyColor* pCl, float* rgba) {\n\tfor (int i = 0; i < 4; i++)\n\t\tpCl->rgba[i] = rgba[i];\n\tcloneFloatToInt(pCl);\n}\nvoid MyColor::setRGBA(MyColor* pCl, float r, float g, float b, float a) {\n\tpCl->rgba[0] = r;\n\tpCl->rgba[1] = g;\n\tpCl->rgba[2] = b;\n\tpCl->rgba[3] = a;\n\tcloneFloatToInt(pCl);\n}\nvoid MyColor::setRGBA(MyColor* pCl, int R, int G, int B, int A) {\n\tpCl->RGBA.channel[0] = R;\n\tpCl->RGBA.channel[1] = G;\n\tpCl->RGBA.channel[2] = B;\n\tpCl->RGBA.channel[3] = A;\n\tcloneIntToFloat(pCl);\n}\nvoid MyColor::setRGBA(MyColor* pCl, unsigned char* RGBA) {\n\tfor (int i = 0; i < 4; i++)\n\t\tpCl->RGBA.channel[i] = RGBA[i];\n\tcloneIntToFloat(pCl);\n}\nvoid MyColor::setUint32(MyColor* pCl, unsigned int RGBA) {\n\tpCl->RGBA.uint32value = RGBA;\n\tcloneIntToFloat(pCl);\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#pragma once\n#include "MyColor.h"\n\nclass Material\n{\npublic:\n\tint shaderN = -1;\n\tint primitiveType = GL_TRIANGLES;\n\tMyColor uColor;\n\tint uTex0 = -1;\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n
\n\n\n\n
\n\n\n\n\n#pragma once\n#include "Material.h"\n#include <vector>\n\nstruct AttribRef \/\/attribute reference\/description\n{\n\tunsigned int glVBOid = 0; \/\/buffer object id\n\tint offset = 0; \/\/variable's offset inside of VBO's element\n\tint stride = 0; \/\/Buffer's element size in bytes\n};\n\nclass DrawJob\n{\npublic:\n\tMaterial mt;\n\tint pointsN = 0; \/\/N of points to draw\n\tunsigned int glVAOid = 0; \/\/will hold data stream attributes mapping\/positions\n\n\t\/\/common attributes\n\tAttribRef aPos;\n\tAttribRef aTuv;\n\n\t\/\/static arrays (vectors) of all loaded DrawJobs, VBO ids\n\tstatic std::vector<DrawJob*> drawJobs;\n\tstatic std::vector<unsigned int> buffersIds;\npublic:\n\tDrawJob();\n\tvirtual ~DrawJob(); \/\/destructor\n\tstatic int cleanUp();\n\tstatic int newBufferId();\n\tint buildVAO() { return buildVAOforShader(this, mt.shaderN); };\n\tstatic int buildVAOforShader(DrawJob* pDJ, int shaderN);\n\tstatic int attachAttribute(int varLocationInShader, int attributeSizeInFloats, AttribRef* pAttribRef);\n\n\tvirtual int setDesirableOffsets(int* pStride, int shaderN) { return setDesirableOffsetsBasic(this, pStride, shaderN); };\n\tstatic int setDesirableOffsetsBasic(DrawJob* pDJ, int* pStride, int shaderN);\n\n\tint execute(float* uMVP, Material* pMt) { return executeDrawJob(this, uMVP, pMt); };\n\tstatic int executeDrawJob(DrawJob* pDJ, float* uMVP, Material* pMt);\n};\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "DrawJob.h"\n#include "platform.h"\n#include "utils.h"\n#include "Shader.h"\n#include "Texture.h"\n\n\/\/static arrays (vectors) of all loaded DrawJobs, VBO ids\nstd::vector<DrawJob*> DrawJob::drawJobs;\nstd::vector<unsigned int> DrawJob::buffersIds;\n\nDrawJob::DrawJob() {\n\tdrawJobs.push_back(this);\n}\nDrawJob::~DrawJob() {\n\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\tif (glVAOid > 0)\n\t\tglDeleteVertexArrays(1, &glVAOid);\n}\nint DrawJob::newBufferId() {\n\tunsigned int bufferId;\n\tglGenBuffers(1, &bufferId);\n\tbuffersIds.push_back(bufferId);\n\treturn (int)bufferId;\n}\n\nint DrawJob::setDesirableOffsetsBasic(DrawJob* pDJ, int* pStride, int shaderN) {\n\t\/\/sets desirable offsets and stride according to given shader needs\n\t\/\/assuming that we have 1 single VBO\n\tShader* pSh = Shader::shaders.at(shaderN);\n\tint stride = 0;\n\tpDJ->aPos.offset = 0; \/\/attribute o_aPos, always 0\n\tstride += sizeof(float) * 3; \/\/aPos size - 3 floats (x,y,z)\n\tif (pSh->l_aTuv >= 0) { \/\/attribute TUV (texture coordinates)\n\t\tpDJ->aTuv.offset = stride; \/\/attribute TUV (texture coordinates)\n\t\tstride += sizeof(float) * 2;\n\t}\n\t*pStride = stride;\n\treturn 1;\n}\nunsigned int activeVBOid;\nint DrawJob::buildVAOforShader(DrawJob* pDJ, int shaderN) {\n\t\/\/delete VAO if exists already\n\tif (pDJ->glVAOid > 0) {\n\t\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\t\tglDeleteVertexArrays(1, &(pDJ->glVAOid));\n\t}\n\tglGenVertexArrays(1, &pDJ->glVAOid);\n\tglBindVertexArray(pDJ->glVAOid);\n\n\t\/\/open shader descriptor to access variables locations\n\tShader* pShader = Shader::shaders.at(pDJ->mt.shaderN);\n\n\tactiveVBOid = 0;\n\tattachAttribute(pShader->l_aPos, 3, &pDJ->aPos);\n\tattachAttribute(pShader->l_aTuv, 2, &pDJ->aTuv);\n\treturn 1;\n}\n\nint DrawJob::attachAttribute(int varLocationInShader, int attributeSizeInFloats, AttribRef* pAR) {\n\tif (varLocationInShader < 0)\n\t\treturn 0; \/\/not used in this shader\n\tif (pAR->glVBOid == 0) {\n\t\tmylog("ERROR in DrawJob::attachAttribute, nk such attribute\/VBO\\n");\n\t\treturn -1;\n\t}\n\tglEnableVertexAttribArray(varLocationInShader);\n\tif (activeVBOid != pAR->glVBOid) {\n\t\tactiveVBOid = pAR->glVBOid;\n\t\t\/\/attach input stream data\n\t\tglBindBuffer(GL_ARRAY_BUFFER, activeVBOid);\n\t}\n\tglVertexAttribPointer(varLocationInShader, attributeSizeInFloats, GL_FLOAT, GL_FALSE, pAR->stride, (void*)(long)pAR->offset);\n\treturn 1;\n}\nint DrawJob::executeDrawJob(DrawJob* pDJ, float* uMVP, Material* pMt) {\n\tif (pMt == NULL)\n\t\tpMt = &(pDJ->mt);\n\tglBindVertexArray(pDJ->glVAOid);\n\tShader* pShader = Shader::shaders.at(pMt->shaderN);\n\tglUseProgram(pShader->GLid);\n\tglUniformMatrix4fv(pShader->l_uMVP, 1, GL_FALSE, (const GLfloat*)uMVP);\n\n\t\/\/attach textures\n\tif (pShader->l_uTex0 >= 0) {\n\t\tint textureId = Texture::getGLid(pMt->uTex0);\n\t\t\/\/pass textureId to shader program\n\t\tglActiveTexture(GL_TEXTURE0); \/\/ activate the texture unit first before binding texture\n\t\tglBindTexture(GL_TEXTURE_2D, textureId);\n\t\t\/\/ Tell the texture uniform sampler to use this texture in the shader by binding to texture unit 0. \n\t\tglUniform1i(pShader->l_uTex0, 0);\n\t}\n\t\/\/other uniforms\n\tif (pShader->l_uColor >= 0) {\n\t\t\/\/float uColor[4] = { 1.f, 0.f, 1.f, 1.f }; \/\/R,G,B, alpha\n\t\tglUniform4fv(pShader->l_uColor, 1, pMt->uColor.forGL());\n\t}\n\tglDrawArrays(pMt->primitiveType, 0, pDJ->pointsN);\n\treturn 1;\n}\nint DrawJob::cleanUp() {\n\tint itemsN = drawJobs.size();\n\t\/\/delete all drawJobs\n\tfor (int i = 0; i < itemsN; i++) {\n\t\tDrawJob* pDJ = drawJobs.at(i);\n\t\tdelete pDJ;\n\t}\n\tdrawJobs.clear();\n\t\/\/delete Buffers\n\titemsN = buffersIds.size();\n\t\/\/delete all buffers\n\tfor (int i = 0; i < itemsN; i++) {\n\t\tunsigned int id = buffersIds.at(i);\n\t\tglDeleteBuffers(1, &id);\n\t}\n\tbuffersIds.clear();\n\n\treturn 1;\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "TheGame.h"\n#include "platform.h"\n#include "linmath.h"\n#include "Texture.h"\n#include "Shader.h"\n#include "DrawJob.h"\n\nextern std::string filesRoot;\n\nstatic const struct\n{\n float x, y, z, tu, tv;\n} vertices[4] =\n{\n { -0.5f, 0.5f, 0.f, 0.f, 0.f }, \/\/top-left\n { -0.5f, -0.5f, 0.f, 0.f, 1.f }, \/\/bottom-left\n { 0.5f, 0.5f, 0.f, 1.f, 0.f }, \/\/top-right\n { 0.5f, -0.5f, 0.f, 1.f, 1.f } \/\/bottom-right\n};\n\nDrawJob* pDJ;\nfloat angle_z = 0;\n\nint TheGame::getReady() {\n bExitGame = false;\n Shader::loadShaders();\n\n pDJ = new DrawJob();\n \/\/define material\n pDJ->mt.shaderN = Shader::spN_flat_tex; \n pDJ->mt.primitiveType = GL_TRIANGLE_STRIP;\n pDJ->mt.uTex0 = Texture::loadTexture(filesRoot + "\/dt\/sample_img.png");\n \/\/pDJ->mt.color0.setRGBA(1.f, 0.f, 1.f, 1.f);\n \/\/pDJ->mt.color0.setRGBA(255, 0, 255,255);\n\n \/\/build and attach data source(s)\n pDJ->pointsN = 4; \/\/number of vertices\n unsigned int glVBOid = pDJ->newBufferId();\n glBindBuffer(GL_ARRAY_BUFFER, glVBOid);\n glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);\n \/\/describe data source\n int stride = sizeof(float) * 5;\n \/\/attributes references\n AttribRef* pAR;\n pAR = &pDJ->aPos; pAR->offset = 0; pAR->glVBOid = glVBOid; pAR->stride = stride;\n pAR = &pDJ->aTuv; pAR->offset = sizeof(float) * 3; pAR->glVBOid = glVBOid; pAR->stride = stride;\n\n \/\/create and fill vertex attributes array (VAO)\n pDJ->buildVAO();\n \/\/end of data stream setting, now it is stored in VAO\n return 1;\n}\nint TheGame::drawFrame() {\n myPollEvents();\n\n mat4x4 m, p, mvp;\n \/\/glClearColor(0.0, 0.0, 0.5, 1.0);\n glClear(GL_COLOR_BUFFER_BIT);\n angle_z += 0.01f;\n mat4x4_identity(m);\n mat4x4_rotate_Z(m, m, angle_z);\n mat4x4_scale_aniso(m, m, 2.0, 1.0, 1.0);\n mat4x4_ortho(p, -screenRatio, screenRatio, -1.f, 1.f, 1.f, -1.f);\n mat4x4_mul(mvp, p, m);\n\n pDJ->execute((float*)mvp, NULL);\n mySwapBuffers();\n return 1;\n}\nint TheGame::cleanUp() {\n Texture::cleanUp();\n Shader::cleanUp();\n DrawJob::cleanUp();\n return 1;\n}\nint TheGame::onScreenResize(int width, int height) {\n if (screenSize[0] == width && screenSize[1] == height)\n return 0;\n screenSize[0] = width;\n screenSize[1] = height;\n screenRatio = (float)width \/ (float)height;\n glViewport(0, 0, width, height);\n mylog(" screen size %d x %d\\n", width, height);\n return 1;\n}\nint TheGame::run() {\n getReady();\n while (!bExitGame) {\n drawFrame();\n }\n cleanUp();\n return 1;\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n
\n\n\n\n\u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0435<\/h2>\n\n\n\n
\n\n\n\n
\n\n\n\n\n#pragma once\n\ntypedef uint32_t myUint64;\ntypedef uint32_t myUint32;\ntypedef uint8_t myUint16;\ntypedef uint8_t myUint8;\n\nvoid mylog(const char* _Format, ...);\nvoid mySwapBuffers();\nvoid myPollEvents();\nint myFopen_s(FILE** pFile, const char* filePath, const char* mode);\n\n<\/pre><\/div>\n\n\n
\n\n\n\n
\n\n\n\n