Skip to content

Commit 7b46222

Browse files
committed
Upgrade SDL3
1 parent c301fab commit 7b46222

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

src/core/Core/Application.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Application::Application(const std::string& title) {
1616
APP_PROFILE_FUNCTION();
1717

1818
const unsigned int init_flags{SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD};
19-
if (SDL_Init(init_flags) != 0) {
20-
APP_ERROR("Error: %s\n", SDL_GetError());
19+
if (!SDL_Init(init_flags)) {
20+
APP_ERROR("Error on SDL_Init(): %s\n", SDL_GetError());
2121
m_exit_status = ExitStatus::FAILURE;
2222
}
2323

@@ -26,8 +26,6 @@ Application::Application(const std::string& title) {
2626
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
2727
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
2828

29-
SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
30-
3129
m_window = std::make_unique<Window>(Window::Settings{title});
3230
}
3331

src/core/Core/Window.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Window::Window(const Settings& settings)
6969
Window::~Window() {
7070
APP_PROFILE_FUNCTION();
7171

72-
SDL_GL_DeleteContext(m_gl_context);
72+
SDL_GL_DestroyContext(m_gl_context);
7373
SDL_DestroyWindow(m_window);
7474

7575
ImGui_ImplOpenGL3_Shutdown();
@@ -100,7 +100,7 @@ void Window::update() {
100100
if (ImGui::BeginMenu("View")) {
101101
ImGui::MenuItem("Some Panel", nullptr, &m_show_some_panel);
102102
ImGui::MenuItem("ImGui Demo Panel", nullptr, &m_show_demo_panel);
103-
ImGui::MenuItem("Debug Panel", nullptr, &m_show_debug_panel);
103+
ImGui::MenuItem("Debug Panels", nullptr, &m_show_debug_panel);
104104
ImGui::EndMenu();
105105
}
106106

@@ -121,7 +121,10 @@ void Window::update() {
121121

122122
// Debug panel
123123
if (m_show_debug_panel) {
124-
ImGui::Begin("Debug panel", &m_show_debug_panel);
124+
ImGui::ShowMetricsWindow();
125+
ImGui::ShowDebugLogWindow();
126+
127+
ImGui::Begin("App debug panel", &m_show_debug_panel);
125128
ImGui::Text("User config path: %s", m_user_config_path.c_str());
126129
ImGui::Text("Global font scaling %f", io.FontGlobalScale);
127130
ImGui::End();

vendor/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FetchContent_Declare(
1111
FetchContent_Declare(
1212
fmt
1313
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
14-
GIT_TAG 10.2.1
14+
GIT_TAG 11.0.2
1515
)
1616

1717
FetchContent_Declare(
@@ -23,19 +23,19 @@ FetchContent_Declare(
2323
FetchContent_Declare(
2424
imgui
2525
GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
26-
GIT_TAG 085781f5ca5372d5fc804d7e44b5bf27a8994af7 # Branch: docking, date: 19.03.2024, 06:52 GMT+1
26+
GIT_TAG 68aa9a86ec933510073932980a0940742ecc833c # Branch: docking, date: 10.09.2024, 04:29 GMT+2
2727
)
2828

2929
FetchContent_Declare(
3030
SDL3
3131
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
32-
GIT_TAG prerelease-3.1.1
32+
GIT_TAG 6e2f2428baca59280cb9bab47f7dac1159f94c46 # Branch: main, date: 12.09.2024, 08:31 GMT+2
3333
)
3434

3535
FetchContent_Declare(
3636
spdlog
3737
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
38-
GIT_TAG v1.13.0
38+
GIT_TAG v1.14.1
3939
)
4040

4141
# Settings

vendor/imgui-setup/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
FetchContent_GetProperties(imgui)
2-
if (NOT imgui_POPULATED)
3-
FetchContent_Populate(imgui)
4-
endif ()
1+
FetchContent_MakeAvailable(imgui)
52

63
add_library(imgui
74
${imgui_SOURCE_DIR}/imgui.cpp ${imgui_SOURCE_DIR}/imgui.h

0 commit comments

Comments
 (0)