Add flag for apps like an editor who doesn't render any scene in the main window.
This commit is contained in:
parent
9d3eb24d23
commit
c47f54992f
3 changed files with 5 additions and 1 deletions
|
@ -26,6 +26,8 @@ public:
|
||||||
virtual void update([[maybe_unused]] const float delta_time) {}
|
virtual void update([[maybe_unused]] const float delta_time) {}
|
||||||
|
|
||||||
virtual void render([[maybe_unused]] GFXCommandBuffer* command_buffer) {}
|
virtual void render([[maybe_unused]] GFXCommandBuffer* command_buffer) {}
|
||||||
|
|
||||||
|
virtual bool wants_no_scene_rendering() { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This is an app's equivalent main(). You can check command line arguments through Engine::comand_line_arguments.
|
/// This is an app's equivalent main(). You can check command line arguments through Engine::comand_line_arguments.
|
||||||
|
|
|
@ -769,7 +769,7 @@ void Engine::render(const int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_renderer != nullptr)
|
if(_renderer != nullptr)
|
||||||
_renderer->render(commandbuffer, _current_scene, *window->render_target, index);
|
_renderer->render(commandbuffer, _app->wants_no_scene_rendering() ? nullptr : _current_scene, *window->render_target, index);
|
||||||
|
|
||||||
_gfx->submit(commandbuffer, index);
|
_gfx->submit(commandbuffer, index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,8 @@ public:
|
||||||
virtual void object_selected([[maybe_unused]] Object object) {}
|
virtual void object_selected([[maybe_unused]] Object object) {}
|
||||||
virtual void asset_selected([[maybe_unused]] std::filesystem::path path, [[maybe_unused]] AssetType type) {}
|
virtual void asset_selected([[maybe_unused]] std::filesystem::path path, [[maybe_unused]] AssetType type) {}
|
||||||
|
|
||||||
|
bool wants_no_scene_rendering() override { return true; }
|
||||||
|
|
||||||
void createDockArea();
|
void createDockArea();
|
||||||
void drawViewport(Scene* scene);
|
void drawViewport(Scene* scene);
|
||||||
void drawAssets();
|
void drawAssets();
|
||||||
|
|
Reference in a new issue