feat: added support for draw_maim_menu_bar() function to be defined by application
This commit is contained in:
parent
6754c406d3
commit
ffe969af30
|
|
@ -2,14 +2,15 @@
|
|||
#include <SFML/Graphics.hpp>
|
||||
#include <SFML/Window.hpp>
|
||||
#include <imgui-SFML.h>
|
||||
#include <imgui.h>
|
||||
|
||||
static sf::RenderWindow window{};
|
||||
static sf::Clock deltaClock{};
|
||||
static AppConfig cfg{};
|
||||
|
||||
extern void configure(AppConfig &config);
|
||||
|
||||
void initialize_window() {
|
||||
AppConfig cfg{};
|
||||
configure(cfg);
|
||||
window.create(cfg.mode, cfg.window_title);
|
||||
if (cfg.frame_rate_limit)
|
||||
|
|
@ -35,6 +36,7 @@ void poll_events() {
|
|||
extern void setup(void);
|
||||
extern void loop(void);
|
||||
extern void draw_scene(sf::RenderTarget &target);
|
||||
extern void draw_main_menu_bar(void);
|
||||
extern void draw_gui(void);
|
||||
|
||||
int main() {
|
||||
|
|
@ -48,6 +50,10 @@ int main() {
|
|||
loop();
|
||||
draw_scene(window);
|
||||
ImGui::SFML::Update(window, deltaClock.restart());
|
||||
if(ImGui::BeginMainMenuBar()) {
|
||||
draw_main_menu_bar();
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
draw_gui();
|
||||
// Render
|
||||
window.clear();
|
||||
|
|
|
|||
Loading…
Reference in a new issue