Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Move away from SFML to SDL2, new beta
Browse files Browse the repository at this point in the history
  • Loading branch information
pierr3 committed Feb 25, 2024
1 parent 254880a commit fe9bf15
Show file tree
Hide file tree
Showing 27 changed files with 1,862 additions and 1,898 deletions.
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,22 @@ find_package(toml11 CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(unofficial-http-parser REQUIRED)
find_package(restinio CONFIG REQUIRED)
find_path(NEARGYE_SEMVER_INCLUDE_DIRS "neargye/semver.hpp")
find_package(semver CONFIG REQUIRED)
find_package(Threads REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(SFML COMPONENTS system window graphics audio CONFIG REQUIRED)
find_package(SFML COMPONENTS window system CONFIG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(SDL2_image CONFIG REQUIRED)

set(APPLE_EXTRA_LIBS "")

include_directories( ${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extern/imgui
${CMAKE_SOURCE_DIR}/extern/PlatformFolders/sago
${OPENGL_INCLUDE_DIR}
${NEARGYE_SEMVER_INCLUDE_DIRS})
${OPENGL_INCLUDE_DIR})

if (APPLE)
set(APPLE_EXTRA_LIBS src/native/osx_resources.mm src/native/window_manager.mm)
set(APPLE_EXTRA_LIBS src/native/osx_resources.mm)
endif()

if(WIN32)
Expand All @@ -94,9 +95,10 @@ add_executable(vector_audio ${GUI_TYPE} src/main.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_tables.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_draw.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_widgets.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui-SFML.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_demo.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_stdlib.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_impl_sdlrenderer2.cpp
${CMAKE_SOURCE_DIR}/extern/imgui/imgui_impl_sdl2.cpp
${CMAKE_SOURCE_DIR}/src/application.cpp
${CMAKE_SOURCE_DIR}/src/config.cpp
${CMAKE_SOURCE_DIR}/src/updater.cpp
Expand Down Expand Up @@ -162,14 +164,18 @@ endif()
target_link_libraries(vector_audio
PRIVATE
OpenSSL::SSL OpenSSL::Crypto
sfml-system sfml-window sfml-graphics sfml-audio
sfml-system sfml-window
toml11::toml11
semver::semver
${LIB_AFV}
nlohmann_json nlohmann_json::nlohmann_json
restinio::restinio
httplib::httplib
Threads::Threads
absl::strings
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
$<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
${OPENGL_LIBRARY})

if (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion VERSION_BETA
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.2-beta.2
1.7.0-beta.1
4 changes: 2 additions & 2 deletions bundle_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lipo -create lib/macos/libafv_native.dylib -output resources/libafv_native.frame
install_name_tool -change @rpath/libafv_native.dylib @loader_path/../Frameworks/libafv_native.framework/libafv_native build/VectorAudio.app/Contents/MacOS/vector_audio
cp -R resources/libafv_native.framework/ build/VectorAudio.app/Contents/Frameworks/libafv_native.framework

xattr -c build/VectorAudio.app
xattr -cr build/VectorAudio.app
if [ $# -eq 1 ]; then
codesign --force --deep --timestamp -s "Developer ID Application" build/VectorAudio.app
codesign --timestamp -s "Developer ID Application" build/VectorAudio.app
fi
31 changes: 0 additions & 31 deletions extern/imgui/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,34 +129,3 @@ namespace ImGui
void MyFunction(const char* name, MyMatrix44* mtx);
}
*/

// Add this to your imconfig.h

#include <SFML/Graphics/Color.hpp>
#include <SFML/System/Vector2.hpp>

#include <cstdint>

#include "imgui-SFML_export.h"

#define IM_VEC2_CLASS_EXTRA \
template<typename T> \
ImVec2(const sf::Vector2<T>& v) { \
x = static_cast<float>(v.x); \
y = static_cast<float>(v.y); \
} \
\
template<typename T> \
operator sf::Vector2<T>() const { \
return sf::Vector2<T>(static_cast<T>(x), static_cast<T>(y)); \
}

#define IM_VEC4_CLASS_EXTRA \
ImVec4(const sf::Color& c) : x(c.r / 255.f), y(c.g / 255.f), z(c.b / 255.f), w(c.a / 255.f) { \
} \
operator sf::Color() const { \
return sf::Color(static_cast<std::uint8_t>(x * 255.f), \
static_cast<std::uint8_t>(y * 255.f), \
static_cast<std::uint8_t>(z * 255.f), \
static_cast<std::uint8_t>(w * 255.f)); \
}
Loading

0 comments on commit fe9bf15

Please sign in to comment.