work on renderer
This commit is contained in:
@@ -15,8 +15,6 @@ ImguiModule::~ImguiModule() {
|
||||
if(app) {
|
||||
WindowModule* wm; { wm = (WindowModule*) moduleInstances[WindowModule()]; }
|
||||
|
||||
wm->getRenderer()->getCmdList().erase(rcmd_it);
|
||||
|
||||
#if WINDOW == 2
|
||||
wm->removeEventFn(ecmd_it);
|
||||
#endif
|
||||
@@ -80,21 +78,6 @@ void ImguiModule::onLoad() {
|
||||
std::cout << "rendererInit failed!\n" << std::endl;
|
||||
}
|
||||
|
||||
wm->getRenderer()->getCmdList().push_back([this](){
|
||||
ImGui::Render();
|
||||
|
||||
rendererRenderDrawData();
|
||||
|
||||
if(ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) {
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
|
||||
window->getWindowImpl().restoreContext();
|
||||
}
|
||||
});
|
||||
|
||||
rcmd_it = --wm->getRenderer()->getCmdList().end()++;
|
||||
|
||||
#if WINDOW == 2
|
||||
ecmd_it = wm->addEventFn([](Archimedes::Event* e){
|
||||
if(e->userData.type() == typeid(SDL_Event*)) {
|
||||
@@ -113,6 +96,17 @@ void ImguiModule::run() {
|
||||
rendererNewFrame();
|
||||
windowNewFrame();
|
||||
ImGui::NewFrame();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
rendererRenderDrawData();
|
||||
|
||||
if(ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) {
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
|
||||
window->getWindowImpl().restoreContext();
|
||||
}
|
||||
};
|
||||
|
||||
bool ImguiModule::onEvent(const Archimedes::Event &e) {
|
||||
|
||||
Reference in New Issue
Block a user