Skip to content

Commit

Permalink
update third-party libraries and a few other small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0g committed Apr 11, 2023
1 parent cc68c39 commit b0c3cb0
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ find_package(bgfx REQUIRED CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
find_package(imgui.cmake REQUIRED CONFIG CMAKE_FIND_ROOT_PATH_BOTH)

add_executable(${PROJECT_NAME})
target_sources(${PROJECT_NAME} PRIVATE main.cpp sdl-imgui/imgui_impl_sdl.cpp
target_sources(${PROJECT_NAME} PRIVATE main.cpp sdl-imgui/imgui_impl_sdl2.cpp
bgfx-imgui/imgui_impl_bgfx.cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
target_link_libraries(
Expand Down
2 changes: 1 addition & 1 deletion compile-shaders-emscripten.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

REM compile shaders

mkdir shader\embuild
if not exist shader\embuild mkdir shader\embuild

REM simple shader
third-party\build\bin\shaderc.exe ^
Expand Down
6 changes: 3 additions & 3 deletions compile-shaders-win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

REM compile shaders

mkdir shader\build
if not exist shader\build mkdir shader\build

REM simple shader
third-party\build\bin\shaderc.exe ^
-f shader\v_simple.sc -o shader\build\v_simple.bin ^
--platform windows --type vertex --verbose -i ./ -p vs_5_0
--platform windows --type vertex --verbose -i ./ -p s_5_0

third-party\build\bin\shaderc.exe ^
-f shader\f_simple.sc -o shader\build\f_simple.bin ^
--platform windows --type fragment --verbose -i ./ -p ps_5_0
--platform windows --type fragment --verbose -i ./ -p s_5_0
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "bgfx-imgui/imgui_impl_bgfx.h"
#include "file-ops.h"
#include "imgui.h"
#include "sdl-imgui/imgui_impl_sdl.h"
#include "sdl-imgui/imgui_impl_sdl2.h"

#if BX_PLATFORM_EMSCRIPTEN
#include "emscripten.h"
Expand Down
190 changes: 147 additions & 43 deletions sdl-imgui/imgui_impl_sdl.cpp → sdl-imgui/imgui_impl_sdl2.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sdl-imgui/imgui_impl_sdl.h → sdl-imgui/imgui_impl_sdl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

// Implemented features:
// [X] Platform: Clipboard support.
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Missing features:
// [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME.
// [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!.

// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
Expand Down
8 changes: 4 additions & 4 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ endif ()
if (NOT EMSCRIPTEN)
ExternalProject_Add(
SDL2
URL https://github.com/libsdl-org/SDL/releases/download/release-2.24.1/SDL2-2.24.1.tar.gz
URL_HASH MD5=10bad2a286f155565edc611f41345de1
URL https://github.com/libsdl-org/SDL/releases/download/release-2.26.4/SDL2-2.26.4.tar.gz
URL_HASH MD5=a8a81a12f3181071fe87ef2eab1202b9
PREFIX ${PREFIX_DIR}
BINARY_DIR ${PREFIX_DIR}/src/SDL2-build/${build_type_dir}
CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}
Expand All @@ -49,7 +49,7 @@ endif ()
ExternalProject_Add(
bgfx
GIT_REPOSITORY https://github.com/pr0g/bgfx.cmake.git
GIT_TAG 26a0f1e54d131841dab511539ff3e6c5e6472fed
GIT_TAG bde3f94ce75ffd184e9a3bdfe947a3bec69233eb
PREFIX ${PREFIX_DIR}
BINARY_DIR ${PREFIX_DIR}/src/bgfx-build/${build_type_dir}
CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}
Expand All @@ -65,7 +65,7 @@ ExternalProject_Add(
ExternalProject_Add(
imgui.cmake
GIT_REPOSITORY https://github.com/pr0g/imgui.cmake.git
GIT_TAG 7e417a39d496820cc25cacbf28b544796a81a634
GIT_TAG 2dddd30d0eb8acb84c7f34926ca241d14d6b6825
PREFIX ${PREFIX_DIR}
BINARY_DIR ${PREFIX_DIR}/src/imgui.cmake-build/${build_type_dir}
CMAKE_COMMAND ${THIRD_PARTY_CMAKE_COMMAND}
Expand Down

0 comments on commit b0c3cb0

Please sign in to comment.