mirror of https://github.com/axmolengine/axmol.git
Add ImGuiEXT::end to end game
This commit is contained in:
parent
41d7f571ef
commit
165b588a10
|
@ -257,11 +257,21 @@ void ImGuiEXT::clearFonts()
|
|||
// if(drawData) drawData->Clear();
|
||||
}
|
||||
|
||||
void ImGuiEXT::end()
|
||||
{
|
||||
_purgeNextLoop = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* begin ImGui frame and draw ImGui stubs
|
||||
*/
|
||||
void ImGuiEXT::beginFrame()
|
||||
{ // drived by event Director::EVENT_BEFORE_DRAW from engine mainLoop
|
||||
if(_purgeNextLoop)
|
||||
{
|
||||
Director::getInstance()->end();
|
||||
return;
|
||||
}
|
||||
if (!_renderPiplines.empty()) {
|
||||
// create frame
|
||||
ImGui_ImplCocos2dx_NewFrame();
|
||||
|
@ -299,7 +309,6 @@ void ImGuiEXT::endFrame() {
|
|||
|
||||
void ImGuiEXT::update()
|
||||
{
|
||||
|
||||
// clear things from last frame
|
||||
usedCCRefIdMap.clear();
|
||||
usedCCRef.clear();
|
||||
|
|
|
@ -66,6 +66,8 @@ public:
|
|||
/// <param name="id">FOURCC starts with '#', such as "#abcd"</id>
|
||||
void removeRenderLoop(const std::string& id);
|
||||
|
||||
void end();
|
||||
|
||||
// imgui helper
|
||||
void image(
|
||||
Texture2D* tex,
|
||||
|
@ -168,6 +170,8 @@ private:
|
|||
};
|
||||
|
||||
std::unordered_map<std::string, FontInfo> _fontsInfoMap;
|
||||
|
||||
bool _purgeNextLoop = false;
|
||||
};
|
||||
|
||||
NS_CC_EXT_END
|
||||
|
|
Loading…
Reference in New Issue