From 2d4729a8772b2f3594ed2b5dba733b1a7bb3cad8 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Tue, 28 May 2024 17:58:24 +0200 Subject: [PATCH] update sdl and sdl_image --- external/sdl/CMakeLists.txt | 4 +++- external/sdl_image/CMakeLists.txt | 3 ++- flake.lock | 16 ++++++++-------- flake.nix | 4 ++-- src/main.cpp | 6 ++++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/external/sdl/CMakeLists.txt b/external/sdl/CMakeLists.txt index 2327684a..f461a7fa 100644 --- a/external/sdl/CMakeLists.txt +++ b/external/sdl/CMakeLists.txt @@ -11,9 +11,11 @@ if (NOT TARGET SDL3::SDL3) GIT_REPOSITORY https://github.com/libsdl-org/SDL #GIT_TAG 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 # tip when looking #GIT_TAG 14f584a94bfd49cf1524db75bf3c419fdf9436cd # tip 26-04-2024 - GIT_TAG 06d6f2cb2518622593570985589700910cf4399f # 13-05-2024 - before + #GIT_TAG 06d6f2cb2518622593570985589700910cf4399f # 13-05-2024 - before # made changes that break imgui release 1.90.6 #GIT_TAG 1103294d33f47ab4c697bb22a9cf27c79c658630 # tip 15-05-2024 + #GIT_TAG aacafd62336363077470f678b6217214b3b49473 # tip 28-05-2024 + GIT_TAG 5fa9432b7d1c1722de93e1ab46e7a9569a47071e # tip 27-05-2024 - before changes made breaking sdl_image FIND_PACKAGE_ARGS # for the future ) FetchContent_MakeAvailable(SDL3) diff --git a/external/sdl_image/CMakeLists.txt b/external/sdl_image/CMakeLists.txt index 9d015116..f749b18b 100644 --- a/external/sdl_image/CMakeLists.txt +++ b/external/sdl_image/CMakeLists.txt @@ -16,7 +16,8 @@ if (NOT TARGET SDL3_image::SDL3_image) GIT_REPOSITORY https://github.com/libsdl-org/SDL_image # waiting on the imgui pr to get merged so i can update sdl <.< #GIT_TAG a45d6e5b84ccc0f3faae6ba7d561709ed600eee7 # tip last check - GIT_TAG a34ccf16f961e6d5a480045eb650fc3dddb4bfaa # tip 14-05-2024 + #GIT_TAG a34ccf16f961e6d5a480045eb650fc3dddb4bfaa # tip 14-05-2024 + GIT_TAG 2fc5310a9a2700fc856663200f94edebeb5e554a # tip 28-05-2024 FIND_PACKAGE_ARGS # for the future ) FetchContent_MakeAvailable(SDL3_image) diff --git a/flake.lock b/flake.lock index 40539b7f..5139225d 100644 --- a/flake.lock +++ b/flake.lock @@ -63,34 +63,34 @@ "sdl3": { "flake": false, "locked": { - "lastModified": 1715616572, - "narHash": "sha256-SCl7RbRThjci0xXUz9vmwDfqp0kenxEuuvoNlx6yiyU=", + "lastModified": 1716778470, + "narHash": "sha256-/esw8XkLIR7/2HLXaCfsOsEy+Idf6XGsnWGC5yXJipk=", "owner": "libsdl-org", "repo": "SDL", - "rev": "06d6f2cb2518622593570985589700910cf4399f", + "rev": "5fa9432b7d1c1722de93e1ab46e7a9569a47071e", "type": "github" }, "original": { "owner": "libsdl-org", "repo": "SDL", - "rev": "06d6f2cb2518622593570985589700910cf4399f", + "rev": "5fa9432b7d1c1722de93e1ab46e7a9569a47071e", "type": "github" } }, "sdl3_image": { "flake": false, "locked": { - "lastModified": 1715708273, - "narHash": "sha256-scNPhzGk+d8VqkOKsSxmH/OVLgkWrOkEeWn/b2f3XaU=", + "lastModified": 1716394356, + "narHash": "sha256-dQ4x7ZbQodOs4PQU90evoa870abC/u0uaVLEqU1nB8k=", "owner": "libsdl-org", "repo": "SDL_image", - "rev": "a34ccf16f961e6d5a480045eb650fc3dddb4bfaa", + "rev": "2fc5310a9a2700fc856663200f94edebeb5e554a", "type": "github" }, "original": { "owner": "libsdl-org", "repo": "SDL_image", - "rev": "a34ccf16f961e6d5a480045eb650fc3dddb4bfaa", + "rev": "2fc5310a9a2700fc856663200f94edebeb5e554a", "type": "github" } }, diff --git a/flake.nix b/flake.nix index d1884b7b..45bd1a2f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,11 @@ flake = false; }; sdl3 = { - url = "github:libsdl-org/SDL/06d6f2cb2518622593570985589700910cf4399f"; # keep in sync this cmake + url = "github:libsdl-org/SDL/5fa9432b7d1c1722de93e1ab46e7a9569a47071e"; # keep in sync this cmake flake = false; }; sdl3_image = { - url = "github:libsdl-org/SDL_image/a34ccf16f961e6d5a480045eb650fc3dddb4bfaa"; + url = "github:libsdl-org/SDL_image/2fc5310a9a2700fc856663200f94edebeb5e554a"; flake = false; }; }; diff --git a/src/main.cpp b/src/main.cpp index 07ab1cff..88567dea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,17 +42,19 @@ int main(int argc, char** argv) { } std::unique_ptr renderer { - SDL_CreateRenderer(window.get(), nullptr, SDL_RENDERER_PRESENTVSYNC), + SDL_CreateRenderer(window.get(), nullptr), &SDL_DestroyRenderer }; if (!renderer) { std::cerr << "SDL_CreateRenderer failed (" << SDL_GetError() << ")\n"; return 1; } + SDL_SetRenderVSync(renderer.get(), SDL_RENDERER_VSYNC_ADAPTIVE); + { SDL_RendererInfo ri; if (SDL_GetRendererInfo(renderer.get(), &ri) == 0) { - std::cout << "SDL Renderer: " << ri.name << "(f:" << ri.flags << ")\n"; + std::cout << "SDL Renderer: " << ri.name << "\n"; } }