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();
|
// if(drawData) drawData->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImGuiEXT::end()
|
||||||
|
{
|
||||||
|
_purgeNextLoop = true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* begin ImGui frame and draw ImGui stubs
|
* begin ImGui frame and draw ImGui stubs
|
||||||
*/
|
*/
|
||||||
void ImGuiEXT::beginFrame()
|
void ImGuiEXT::beginFrame()
|
||||||
{ // drived by event Director::EVENT_BEFORE_DRAW from engine mainLoop
|
{ // drived by event Director::EVENT_BEFORE_DRAW from engine mainLoop
|
||||||
|
if(_purgeNextLoop)
|
||||||
|
{
|
||||||
|
Director::getInstance()->end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!_renderPiplines.empty()) {
|
if (!_renderPiplines.empty()) {
|
||||||
// create frame
|
// create frame
|
||||||
ImGui_ImplCocos2dx_NewFrame();
|
ImGui_ImplCocos2dx_NewFrame();
|
||||||
|
@ -299,7 +309,6 @@ void ImGuiEXT::endFrame() {
|
||||||
|
|
||||||
void ImGuiEXT::update()
|
void ImGuiEXT::update()
|
||||||
{
|
{
|
||||||
|
|
||||||
// clear things from last frame
|
// clear things from last frame
|
||||||
usedCCRefIdMap.clear();
|
usedCCRefIdMap.clear();
|
||||||
usedCCRef.clear();
|
usedCCRef.clear();
|
||||||
|
|
|
@ -65,6 +65,8 @@ public:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">FOURCC starts with '#', such as "#abcd"</id>
|
/// <param name="id">FOURCC starts with '#', such as "#abcd"</id>
|
||||||
void removeRenderLoop(const std::string& id);
|
void removeRenderLoop(const std::string& id);
|
||||||
|
|
||||||
|
void end();
|
||||||
|
|
||||||
// imgui helper
|
// imgui helper
|
||||||
void image(
|
void image(
|
||||||
|
@ -168,6 +170,8 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unordered_map<std::string, FontInfo> _fontsInfoMap;
|
std::unordered_map<std::string, FontInfo> _fontsInfoMap;
|
||||||
|
|
||||||
|
bool _purgeNextLoop = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_CC_EXT_END
|
NS_CC_EXT_END
|
||||||
|
|
Loading…
Reference in New Issue