Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7a1ab72
starting to transition from SDL2 to SDL3
JonathSpirit Jul 25, 2026
3c0d424
client lib is compilable, continue SDL3 transition
JonathSpirit Jul 26, 2026
8f31215
guiWindow_003: make it usable with sdl3
JonathSpirit Jul 26, 2026
253dd58
working on examples, list of issues:
JonathSpirit Jul 26, 2026
05fbfb6
BaseDataAccessor: add a method to retrieve the associated manager
JonathSpirit Jul 28, 2026
b7bd98a
audio_manager: rename g_device -> g_defaultMixer, add ability to retr…
JonathSpirit Jul 28, 2026
8c5d7cb
SoundBuffer: add playAudio() helper
JonathSpirit Jul 28, 2026
b4d70d5
clientServerLifeSimulator_004: fix audio
JonathSpirit Jul 28, 2026
56bb6bc
windows: add -f flag on curl, fix new repo msys2 link
JonathSpirit Jul 28, 2026
89f923f
bump cmake to 4.4.x for linux, mac and windows
JonathSpirit Jul 28, 2026
31702de
bump json to 3.12.0
JonathSpirit Jul 28, 2026
e239b2f
linux: update dependencies list
JonathSpirit Jul 28, 2026
3cb6494
remove support for windows 32bit
JonathSpirit Jul 28, 2026
34c5d61
linux: fix typo
JonathSpirit Jul 28, 2026
6d73b87
update SDL3 deps
JonathSpirit Jul 28, 2026
4df565e
SDL: stop building SDL_GTK
JonathSpirit Jul 28, 2026
3e64395
linux: use cmake 4.4.0, it seems that 4.4.x have a bug with getresuid
JonathSpirit Jul 28, 2026
9fcbb96
SDL3 fix cmake args, none was working
JonathSpirit Jul 28, 2026
d8a6f0d
bump doctest to v2.5.3
JonathSpirit Jul 28, 2026
c93ae94
Event: restore _onWindowEvent, add _onDisplayEvent, _onTextEditingCan…
JonathSpirit Jul 28, 2026
0f7e26e
Context: add startTextInput() and stopTextInput() helpers
JonathSpirit Jul 28, 2026
b85afc4
ObjTextInputBox: use new SDL3 way of handling text input events
JonathSpirit Jul 28, 2026
c32d215
Context::initVulkanSurfaceless: fix missing assign of vulkanFunctions
JonathSpirit Jul 29, 2026
ad6101b
TextureImage::copyToSurface: fix bad surface creation
JonathSpirit Jul 29, 2026
715dfc1
audio: add tracks
JonathSpirit Jul 30, 2026
2c3e437
renaming SoundBuffer -> Audio
JonathSpirit Jul 30, 2026
4e9b854
audio: add semi-auto tracks control in order to get a working audio s…
JonathSpirit Aug 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/cmake_linux_gcc_64bit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ jobs:
- name: Install gcc
run: sudo apt-get update && sudo apt-get install gcc-11 g++-11

- name: Install dependencies
- name: Install SDL dependencies
run: |
sudo apt-get install libx11-dev libxrandr-dev libudev-dev \
libglu1-mesa-dev freeglut3-dev mesa-common-dev libflac-dev libogg-dev \
libvorbis-dev libopenal-dev libxcursor-dev
sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev libusb-1.0-0-dev

- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v2.0.2
uses: jwlawson/actions-setup-cmake@v2.2.0
with:
cmake-version: '3.28.x'
cmake-version: '4.4.0'

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cmake_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
id: cpu-cores

- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v2.0.2
uses: jwlawson/actions-setup-cmake@v2.2.0
with:
cmake-version: '3.28.x'
cmake-version: '4.4.x'

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/cmake_windows_mingw-w64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
matrix:
include:
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: mingw32, env: i686 }

runs-on: windows-latest
defaults:
Expand All @@ -35,11 +34,11 @@ jobs:

- name: Downloading cmake
run: |
curl -O "https://repo.msys2.org/mingw/${{matrix.sys}}/mingw-w64-${{matrix.env}}-cmake-4.1.1-1-any.pkg.tar.zst"
curl -O -f "https://repo.msys2.org/mingw/${{matrix.sys}}/mingw-w64-${{matrix.env}}-cmake-4.4.0-1-any.pkg.tar.zst"

- name: Installing cmake
run: |
pacman -U --noconfirm "mingw-w64-${{matrix.env}}-cmake-4.1.1-1-any.pkg.tar.zst"
pacman -U --noconfirm "mingw-w64-${{matrix.env}}-cmake-4.4.0-1-any.pkg.tar.zst"

- name: Create Build Environment
run: cmake -E make_directory "${{github.workspace}}\build"
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ jobs:
- name: Install gcc
run: sudo apt-get update && sudo apt-get install gcc-11 g++-11

- name: Install dependencies
- name: Install SDL dependencies
run: |
sudo apt-get install libx11-dev libxrandr-dev libudev-dev \
libglu1-mesa-dev freeglut3-dev mesa-common-dev libflac-dev libogg-dev \
libvorbis-dev libopenal-dev libxcursor-dev
sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev libusb-1.0-0-dev

- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v2.0.2
uses: jwlawson/actions-setup-cmake@v2.2.0
with:
cmake-version: '3.28.x'
cmake-version: '4.4.0'

- name: Handling project dependencies
shell: bash
Expand Down
21 changes: 8 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ if(APPLE)
add_compile_options(-Wno-nullability-extension)
endif()

if(NOT WIN32)
set(FGE_SDL_MAIN "")
else()
set(FGE_SDL_MAIN "SDL2::SDL2main")
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#Get the GIT version target
Expand Down Expand Up @@ -356,7 +350,8 @@ target_sources(${FGE_LIB_NAME} PRIVATE

target_sources(${FGE_LIB_NAME} PRIVATE
sources/accessor/C_animation.cpp
sources/accessor/C_texture.cpp)
sources/accessor/C_texture.cpp
sources/accessor/C_audio.cpp)

target_sources(${FGE_LIB_NAME} PRIVATE
sources/C_commandHandler.cpp
Expand Down Expand Up @@ -447,7 +442,7 @@ if(WIN32)
endif()

target_link_libraries(${FGE_LIB_NAME} PRIVATE glslang::glslang-default-resource-limits glslang::SPIRV glslang::glslang)
target_link_libraries(${FGE_LIB_NAME} PUBLIC SDL2::SDL2 SDL2_image::SDL2_image SDL2_mixer::SDL2_mixer)
target_link_libraries(${FGE_LIB_NAME} PUBLIC SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer)
target_link_libraries(${FGE_LIB_NAME} PRIVATE BZip2::bz2_static)
target_link_libraries(${FGE_LIB_NAME} PRIVATE LZ4::lz4_static)
target_link_libraries(${FGE_LIB_NAME} PRIVATE fmt::fmt-header-only)
Expand All @@ -457,7 +452,7 @@ target_link_libraries(${FGE_LIB_NAME} PUBLIC glm::glm-header-only volk::volk_hea
target_link_libraries(${FGE_LIB_NAME} PRIVATE OpenSSL::SSL OpenSSL::Crypto)

target_link_libraries(${FGE_SERVER_LIB_NAME} PRIVATE glslang::glslang-default-resource-limits glslang::SPIRV glslang::glslang)
target_link_libraries(${FGE_SERVER_LIB_NAME} PUBLIC SDL2::SDL2 SDL2_image::SDL2_image)
target_link_libraries(${FGE_SERVER_LIB_NAME} PUBLIC SDL3::SDL3 SDL3_image::SDL3_image)
target_link_libraries(${FGE_SERVER_LIB_NAME} PRIVATE BZip2::bz2_static)
target_link_libraries(${FGE_SERVER_LIB_NAME} PRIVATE LZ4::lz4_static)
target_link_libraries(${FGE_SERVER_LIB_NAME} PRIVATE fmt::fmt-header-only)
Expand Down Expand Up @@ -547,8 +542,8 @@ function(CopyFilesToRuntimeDirectory FILE_PATHS MAIN_TARGET_NAME)
endfunction()

if (WIN32)
CopyTargetDllsToRuntimeDirectory("SDL2::SDL2;SDL2_image::SDL2_image;SDL2_mixer::SDL2_mixer" FgeClientExeDeps)
CopyTargetDllsToRuntimeDirectory("SDL2::SDL2;SDL2_image::SDL2_image" FgeServerExeDeps)
CopyTargetDllsToRuntimeDirectory("SDL3::SDL3;SDL3_image::SDL3_image;SDL3_mixer::SDL3_mixer" FgeClientExeDeps)
CopyTargetDllsToRuntimeDirectory("SDL3::SDL3;SDL3_image::SDL3_image" FgeServerExeDeps)
endif()

add_custom_target(ResourcesSymlink
Expand All @@ -562,8 +557,8 @@ add_dependencies(FgeClientExeDeps ResourcesSymlink)
add_dependencies(FgeServerExeDeps ResourcesSymlink)

#Set some helper variables for executables
set(FGE_CLIENT_LIBS ${FGE_SDL_MAIN} SDL2::SDL2 SDL2_image::SDL2_image SDL2_mixer::SDL2_mixer ${FGE_LIB_NAME})
set(FGE_SERVER_LIBS SDL2::SDL2 SDL2_image::SDL2_image ${FGE_SERVER_LIB_NAME})
set(FGE_CLIENT_LIBS SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer ${FGE_LIB_NAME})
set(FGE_SERVER_LIBS SDL3::SDL3 SDL3_image::SDL3_image ${FGE_SERVER_LIB_NAME})

#Tests
if (FGE_BUILD_TESTS)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ limitations under the License.
FastEngine must be built using a C++20 compatible compiler :
- For GNU/Linux : GCC-11 minimum
- For Windows : MINGW-W64, GCC-11 minimum
- - (32bits or UCRT 64bits)
- - UCRT 64bits
- For MAC : AppleClang 13 minimum

Unsupported compiler/tools :
- Microsoft compiler, (it should work but is not tested on)

Working/supported architecture :
- 32bits
- 32bits (not on windows, not tested)
- 64bits
- ARM

Expand Down
22 changes: 11 additions & 11 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,28 @@ AddCmakeDependency(freetype
"-DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_ZLIB=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_BROTLI=ON -DFT_DISABLE_BZIP2=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"")

AddCmakeDependency(SDL2
AddCmakeDependency(SDL3
https://github.com/libsdl-org/SDL.git
release-2.32.10
release-3.4.12
ON
"-DSDL_TEST=OFF -DSDL_STATIC_PIC=ON"
"-DSDL_TESTS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"")

AddCmakeDependency(SDL2_image
AddCmakeDependency(SDL3_image
https://github.com/libsdl-org/SDL_image.git
release-2.8.8
release-3.4.4
ON
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDL2IMAGE_AVIF=OFF -DDAV1D_ASM=OFF -DSDL2IMAGE_SAMPLES=OFF -DSDL2IMAGE_DEPS_SHARED=OFF -DSDL2IMAGE_VENDORED=ON -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/libs/SDL2"
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDL3IMAGE_AVIF=OFF -DDAV1D_ASM=OFF -DSDL3IMAGE_SAMPLES=OFF -DSDL3IMAGE_DEPS_SHARED=OFF -DSDL3IMAGE_VENDORED=ON -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/libs/SDL3"
"")
add_dependencies(SDL2_image SDL2)
add_dependencies(SDL3_image SDL3)

AddCmakeDependency(SDL2_mixer
AddCmakeDependency(SDL3_mixer
https://github.com/libsdl-org/SDL_mixer.git
release-2.8.1
release-3.2.4
ON
"-DSDL2MIXER_VENDORED=ON -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/libs/SDL2"
"-DSDL3MIXER_VENDORED=ON -DCMAKE_PREFIX_PATH=${CMAKE_CURRENT_BINARY_DIR}/libs/SDL3"
"")
add_dependencies(SDL2_mixer SDL2)
add_dependencies(SDL3_mixer SDL3)

AddCmakeDependency(glm
https://github.com/g-truc/glm.git
Expand Down
7 changes: 4 additions & 3 deletions examples/clientServerLifeSimulator_004/client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#include "FastEngine/object/C_objText.hpp"
#include "FastEngine/object/C_objTextinputbox.hpp"
#include "FastEngine/object/C_objWindow.hpp"
#include "SDL.h"
#include "SDL3/SDL.h"
#include "SDL3/SDL_main.h"
#include "definition.hpp"

#include "C_creature.hpp"
Expand All @@ -57,7 +58,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
Context::enumerateExtensions();

SurfaceSDLWindow window(instance, FGE_WINDOWPOS_CENTERED, {LIFESIM_MAP_WIDTH, LIFESIM_MAP_HEIGHT},
SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
SDL_WINDOW_RESIZABLE);

// Check that the window was successfully created
if (!window.isCreated())
Expand Down Expand Up @@ -252,7 +253,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
{
//Process events
event.process();
if (event.isEventType(SDL_QUIT))
if (event.isEventType(SDL_EVENT_QUIT))
{
running = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ FGE_OBJ_UPDATE_BODY(Creature)
this->_speakDelay = std::chrono::milliseconds(fge::_random.range(6000, 50000));
this->_speakSound = "ugandan" + fge::string::ToStr(fge::_random.range(1, 2));

Mix_PlayChannel(-1, this->_speakSound.retrieve(), 0);
this->_speakSound.playAudio();
}

this->updateMoveable(*this, deltaTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "FastEngine/accessor/C_animation.hpp"
#include "FastEngine/accessor/C_font.hpp"
#ifndef FGE_DEF_SERVER
#include "FastEngine/accessor/C_soundBuffer.hpp"
#include "FastEngine/accessor/C_audio.hpp"
#endif // FGE_DEF_SERVER
#include "FastEngine/manager/texture_manager.hpp"
#include "FastEngine/network/C_packet.hpp"
Expand Down Expand Up @@ -110,7 +110,7 @@ class Creature : public ls::CustomObject, public fge::Subscriber

#ifndef FGE_DEF_SERVER
fge::Clock _speakClock;
fge::SoundBuffer _speakSound;
fge::Audio _speakSound;
std::chrono::milliseconds _speakDelay;

fge::Animation _anim;
Expand Down
7 changes: 4 additions & 3 deletions examples/deepText_005/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#include "FastEngine/object/C_objText.hpp"
#include "FastEngine/object/C_objTextinputbox.hpp"
#include "FastEngine/vulkan/vulkanGlobal.hpp"
#include "SDL.h"
#include "SDL3/SDL.h"
#include "SDL3/SDL_main.h"
#include <cmath>
#include <iostream>

Expand Down Expand Up @@ -118,7 +119,7 @@ class MainScene : public fge::Scene
{
//Update event
event.process();
if (event.isEventType(SDL_QUIT))
if (event.isEventType(SDL_EVENT_QUIT))
{
running = false;
}
Expand Down Expand Up @@ -183,7 +184,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
auto instance = Context::init(SDL_INIT_VIDEO | SDL_INIT_EVENTS, "example 005: deepText");
Context::enumerateExtensions();

SurfaceSDLWindow window(instance, FGE_WINDOWPOS_CENTERED, {800, 600}, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
SurfaceSDLWindow window(instance, FGE_WINDOWPOS_CENTERED, {800, 600}, SDL_WINDOW_RESIZABLE);

// Check that the window was successfully created
if (!window.isCreated())
Expand Down
29 changes: 21 additions & 8 deletions examples/guiWindow_003/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#include "FastEngine/object/C_objSlider.hpp"
#include "FastEngine/object/C_objTextList.hpp"
#include "FastEngine/object/C_objWindow.hpp"
#include "SDL.h"
#include "SDL3/SDL.h"
#include "SDL3/SDL_main.h"
#include <iostream>

//Create the MainScene class
Expand All @@ -43,9 +44,17 @@ class MainScene : public fge::Scene
this->setCallbackContext({&event, &guiElementHandler});

//Init texture manager
fge::texture::gManager.initialize();
if (!fge::texture::gManager.initialize())
{
std::cout << "Failed to initialize texture manager" << std::endl;
return;
}
//Init font manager
fge::font::gManager.initialize();
if (!fge::font::gManager.initialize())
{
std::cout << "Failed to initialize font manager" << std::endl;
return;
}

//Load texture
fge::texture::gManager.loadFromFile("close", "resources/images/window/close.png");
Expand Down Expand Up @@ -129,7 +138,7 @@ class MainScene : public fge::Scene

//Add a callback to duplicate the window
event._onKeyDown.addLambda([&]([[maybe_unused]] fge::Event const& event, SDL_KeyboardEvent const& keyEvent) {
if (keyEvent.keysym.sym == SDLK_SPACE)
if (keyEvent.key == SDLK_SPACE)
{
auto* newWindow =
this->duplicateObject(objWindow->_myObjectData.lock()->getSid())->getObject<fge::ObjWindow>();
Expand Down Expand Up @@ -163,11 +172,11 @@ class MainScene : public fge::Scene
{
//Update event
event.process();
if (event.isEventType(SDL_QUIT))
if (event.isEventType(SDL_EVENT_QUIT))
{
running = false;
}
if (event.isEventType(SDL_WINDOWEVENT))
if (event.isEventType(SDL_EVENT_WINDOW_RESIZED))
{
auto view = renderWindow.getView();
view.resizeFixCenter({event.getWindowSize().x, event.getWindowSize().y});
Expand Down Expand Up @@ -208,7 +217,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
auto instance = Context::init(SDL_INIT_VIDEO | SDL_INIT_EVENTS, "example 003: guiWindow");
Context::enumerateExtensions();

SurfaceSDLWindow window(instance, FGE_WINDOWPOS_CENTERED, {800, 600}, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
SurfaceSDLWindow window(instance, FGE_WINDOWPOS_CENTERED, {800, 600}, SDL_WINDOW_RESIZABLE);

// Check that the window was successfully created
if (!window.isCreated())
Expand All @@ -221,7 +230,11 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
Context vulkanContext(window);
vulkanContext._garbageCollector.enable(true);

fge::shader::gManager.initialize();
if (!fge::shader::gManager.initialize())
{
std::cout << "Could not initialize shader manager" << std::endl;
return 1;
}
fge::shader::gManager.loadFromFile(FGE_OBJSHAPE_INSTANCES_SHADER_VERTEX,
"resources/shaders/objShapeInstances_vertex.vert", Shader::Type::SHADER_VERTEX,
fge::shader::ShaderInputTypes::SHADER_GLSL);
Expand Down
Loading
Loading