From faeab56ebedcf7d8f77ce18082b7ba9ca90d6fbf Mon Sep 17 00:00:00 2001 From: Dicky Date: Fri, 17 Mar 2023 18:41:41 +0800 Subject: [PATCH] update submodule and change application framework API --- imgui | 2 +- test/immidi.cpp | 39 ++++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/imgui b/imgui index 5e33e07..0eddf3b 160000 --- a/imgui +++ b/imgui @@ -1 +1 @@ -Subproject commit 5e33e07fc522d42fd0f8c0bb0d647be85f06b43f +Subproject commit 0eddf3b4640ef6044d1bed2a09f378db5fe1169b diff --git a/test/immidi.cpp b/test/immidi.cpp index f289208..4970584 100644 --- a/test/immidi.cpp +++ b/test/immidi.cpp @@ -1890,18 +1890,7 @@ static std::string ReplaceDigital(const std::string str) return result; } -void Application_GetWindowProperties(ApplicationWindowProperty& property) -{ - property.name = APP_NAME; - property.viewport = false; - property.docking = false; - property.auto_merge = false; - property.power_save = true; - property.width = 1680; - property.height = 960; -} - -void Application_SetupContext(ImGuiContext* ctx) +static void Midi_SetupContext(ImGuiContext* ctx) { #ifdef USE_BOOKMARK ImGuiSettingsHandler bookmark_ini_handler; @@ -1929,7 +1918,7 @@ void Application_SetupContext(ImGuiContext* ctx) #endif } -void Application_Initialize(void** handle) +static void Midi_Initialize(void** handle) { #if !IMGUI_APPLICATION_PLATFORM_SDL2 SDL_Init(SDL_INIT_AUDIO | SDL_INIT_TIMER); @@ -2012,7 +2001,7 @@ void Application_Initialize(void** handle) libmidi_init(); } -void Application_Finalize(void** handle) +static void Midi_Finalize(void** handle) { if (save_dialog) delete save_dialog; libmidi_release(); @@ -2021,11 +2010,7 @@ void Application_Finalize(void** handle) #endif } -void Application_DropFromSystem(std::vector& drops) -{ -} - -bool Application_Frame(void * handle, bool app_will_quit) +static bool Midi_Frame(void * handle, bool app_will_quit) { ImGuiIO& io = ImGui::GetIO(); (void)io; bool multiviewport = io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable; @@ -2600,3 +2585,19 @@ bool Application_Frame(void * handle, bool app_will_quit) } return app_will_quit; } + +void Application_Setup(ApplicationWindowProperty& property) +{ + property.name = APP_NAME; + property.viewport = false; + property.docking = false; + property.auto_merge = false; + property.power_save = true; + property.width = 1680; + property.height = 960; + + property.application.Application_SetupContext = Midi_SetupContext; + property.application.Application_Initialize = Midi_Initialize; + property.application.Application_Finalize = Midi_Finalize; + property.application.Application_Frame = Midi_Frame; +}