代码拉取完成,页面将自动刷新
同步操作将从 simdsoft/axmol 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Sync from https://github.com/Xrysnow/cocos2d-x-imgui and do a little changes
ImGui_ImplCocos2dx_NewFrame
to avoid error when cc.Director
pausedInit/Shutdown
, Restore all callbacks for glfw to solve recreate ImGuiPresenter
instance supportFOURCC
for key of ImGui render loopImGuiPresenter::getInstance()->enableDPIScale();
addFont,removeFont,clearFonts
to manage ImGui fonts, with ImGui API, very hard to do correctly.#include "ImGui/ImGuiPresenter.h"
USING_NS_AX;
USING_NS_AX_EXT;
class GameScene : public Scene {
public:
void onEnter() override
{
Scene::onEnter();
ImGuiPresenter::getInstance()->addFont(R"(C:\Windows\Fonts\msyh.ttc)");
/* For Simplified Chinese support, please use:
ImGuiPresenter::getInstance()->addFont(R"(C:\Windows\Fonts\msyh.ttc)", ImGuiPresenter::DEFAULT_FONT_SIZE,
ImGuiPresenter::CHS_GLYPH_RANGE::GENERAL);
*/
ImGuiPresenter::getInstance()->enableDPIScale(); // enable dpi scale for 4K display support, depends at least one valid ttf/ttc font was added.
ImGuiPresenter::getInstance()->addRenderLoop("#im01", AX_CALLBACK_0(GameScene::onImGuiDraw, this), this);
}
void onExit() override
{
Scene::onExit();
ImGuiPresenter::getInstance()->removeRenderLoop("#im01");
}
void onImGuiDraw()
{
ImGui::Begin("window");
ImGui::Text("FPS=%.1f", 1.f / ImGui::GetIO().DeltaTime);
ImGui::End();
}
}
More about use imgui widgets, please see: https://github.com/ocornut/imgui
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。