From eb5f2f0e3e2f4ba515b9b32c2e5364ee482063c7 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Mon, 9 Jun 2025 01:01:31 +0200 Subject: [PATCH] Remove SDL dependency --- CMakeLists.txt | 18 +------ src/assets.cpp | 118 ++++++++++++++++++++++++-------------------- src/assets.hpp | 20 ++++---- src/audio.cpp | 42 ++++++++-------- src/audio.hpp | 17 +++---- src/definitions.hpp | 14 +++--- src/input.hpp | 7 ++- src/level.cpp | 32 ++++++------ src/main.cpp | 101 ++++++++++++------------------------- src/render.cpp | 54 ++++++++++---------- src/sprite.hpp | 1 - 11 files changed, 186 insertions(+), 238 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 518f9d7..0737d71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,19 +7,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Option to switch real platform vs. SDL implementation... include(FetchContent) -FetchContent_Declare( - SDL3 - URL https://github.com/libsdl-org/SDL/releases/download/release-3.2.14/SDL3-3.2.14.tar.gz - OVERRIDE_FIND_PACKAGE -) -FetchContent_MakeAvailable(SDL3) - -FetchContent_Declare( - SDL3_ttf - URL https://github.com/libsdl-org/SDL_ttf/releases/download/release-3.2.2/SDL3_ttf-3.2.2.tar.gz - OVERRIDE_FIND_PACKAGE -) -FetchContent_MakeAvailable(SDL3_ttf) FetchContent_Declare( entt @@ -29,9 +16,6 @@ FetchContent_Declare( FetchContent_MakeAvailable(entt) find_package(entt CONFIG REQUIRED) -find_package(SDL3 CONFIG REQUIRED) -find_package(SDL3_ttf CONFIG REQUIRED) - add_executable(HansTheGatherer src/main.cpp src/audio.cpp @@ -41,6 +25,6 @@ add_executable(HansTheGatherer src/render.cpp ) -target_link_libraries(HansTheGatherer SDL3::SDL3 SDL3_ttf::SDL3_ttf EnTT) +target_link_libraries(HansTheGatherer EnTT) set_property(TARGET HansTheGatherer PROPERTY CXX_STANDARD 20) diff --git a/src/assets.cpp b/src/assets.cpp index 3148517..87b3db2 100644 --- a/src/assets.cpp +++ b/src/assets.cpp @@ -1,6 +1,5 @@ #include "assets.hpp" #include "audio.hpp" -#include "definitions.hpp" #include @@ -36,79 +35,90 @@ static constexpr uint8_t DEFAULT_FONT_DATA[] = { #embed "../assets/fonts/OpenTTD-Sans.ttf" }; -SDL_Texture* load_texture(uint8_t const* data, size_t size, SDL_Renderer* renderer) -{ - auto* iostream = SDL_IOFromConstMem(data, size); - SDL_Surface* surface = SDL_LoadBMP_IO(iostream, false); - if (surface == nullptr) - { - // spdlog::error("Failed to load SDL surface!\nCause: {}", SDL_GetError()); - } +// SDL_Texture* load_texture(uint8_t const* data, size_t size, SDL_Renderer* renderer) +// { +// auto* iostream = SDL_IOFromConstMem(data, size); +// SDL_Surface* surface = SDL_LoadBMP_IO(iostream, false); +// if (surface == nullptr) +// { +// // spdlog::error("Failed to load SDL surface!\nCause: {}", SDL_GetError()); +// } - SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); - if (texture == nullptr) - { - // spdlog::error("Failed to create texture from surface!\nCause: {}", SDL_GetError()); - } +// SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); +// if (texture == nullptr) +// { +// // spdlog::error("Failed to create texture from surface!\nCause: {}", SDL_GetError()); +// } - return texture; -} +// return texture; +// } -AudioAsset load_audio(uint8_t const* data, size_t size) -{ - AudioAsset audio_asset; +// AudioAsset load_audio(uint8_t const* data, size_t size) +// { +// AudioAsset audio_asset; - auto* iostream = SDL_IOFromConstMem(data, size); - bool res = SDL_LoadWAV_IO( - iostream, false, &audio_asset.spec, &audio_asset.buffer, &audio_asset.buffer_length); - if (!res) - { - // spdlog::error("Failed to load audio file!\nCause: {}", SDL_GetError()); - } - return audio_asset; -} +// auto* iostream = SDL_IOFromConstMem(data, size); +// bool res = SDL_LoadWAV_IO( +// iostream, false, &audio_asset.spec, &audio_asset.buffer, &audio_asset.buffer_length); +// if (!res) +// { +// // spdlog::error("Failed to load audio file!\nCause: {}", SDL_GetError()); +// } +// return audio_asset; +// } -FontAsset load_font(uint8_t const* data, size_t size) -{ - FontAsset font_asset; +// FontAsset load_font(uint8_t const* data, size_t size) +// { +// FontAsset font_asset; - auto* iostream = SDL_IOFromConstMem(data, size); - auto* ttf = TTF_OpenFontIO(iostream, false, 20); +// auto* iostream = SDL_IOFromConstMem(data, size); +// auto* ttf = TTF_OpenFontIO(iostream, false, 20); - font_asset.font = ttf; +// font_asset.font = ttf; - return font_asset; -} +// return font_asset; +// } AssetModule::AssetModule(entt::registry& registry) { - auto renderer = registry.ctx().get().renderer; + // auto renderer = registry.ctx().get().renderer; - auto* background = load_texture(BACKGROUND_DATA, sizeof(BACKGROUND_DATA), renderer); + // auto* background = load_texture(BACKGROUND_DATA, sizeof(BACKGROUND_DATA), renderer); TextureAtlasLayout background_layout = {.width = 866, .height = 510, .rows = 1, .columns = 1}; - auto* fruits = load_texture(FRUITS_DATA, sizeof(FRUITS_DATA), renderer); + // auto* fruits = load_texture(FRUITS_DATA, sizeof(FRUITS_DATA), renderer); TextureAtlasLayout fruits_layout = {.width = 16, .height = 16, .rows = 6, .columns = 38}; - auto* spiders = load_texture(SPIDERS_DATA, sizeof(SPIDERS_DATA), renderer); + // auto* spiders = load_texture(SPIDERS_DATA, sizeof(SPIDERS_DATA), renderer); TextureAtlasLayout spiders_layout = {.width = 16, .height = 16, .rows = 2, .columns = 4}; - auto* basket = load_texture(BASKET_DATA, sizeof(BASKET_DATA), renderer); + // auto* basket = load_texture(BASKET_DATA, sizeof(BASKET_DATA), renderer); TextureAtlasLayout basket_layout = {.width = 16, .height = 16, .rows = 1, .columns = 1}; - registry.ctx().emplace(TextureAssets{ - .background = Texture{.sdl_texture = background, .texture_atlas_layout = background_layout}, - .fruits = Texture{.sdl_texture = fruits, .texture_atlas_layout = fruits_layout}, - .spiders = Texture{.sdl_texture = spiders, .texture_atlas_layout = spiders_layout}, - .basket = Texture{.sdl_texture = basket, .texture_atlas_layout = basket_layout}}); + // registry.ctx().emplace(TextureAssets{ + // .background = Texture{.sdl_texture = background, .texture_atlas_layout = + // background_layout}, .fruits = Texture{.sdl_texture = fruits, .texture_atlas_layout = + // fruits_layout}, .spiders = Texture{.sdl_texture = spiders, .texture_atlas_layout = + // spiders_layout}, .basket = Texture{.sdl_texture = basket, .texture_atlas_layout = + // basket_layout}}); + registry.ctx().emplace( + TextureAssets{.background = Texture{.texture_atlas_layout = background_layout}, + .fruits = Texture{.texture_atlas_layout = fruits_layout}, + .spiders = Texture{.texture_atlas_layout = spiders_layout}, + .basket = Texture{.texture_atlas_layout = basket_layout}}); - auto background_music = load_audio(BACKGROUND_MUSIC_DATA, sizeof(BACKGROUND_MUSIC_DATA)); - auto pickup_sound = load_audio(PICKUP_SOUND_DATA, sizeof(PICKUP_SOUND_DATA)); - auto hit_sound = load_audio(HIT_SOUND_DATA, sizeof(HIT_SOUND_DATA)); - registry.ctx().emplace(AudioAssets{.background_music = background_music, - .pickup_sound = pickup_sound, - .hit_sound = hit_sound}); + // auto background_music = load_audio(BACKGROUND_MUSIC_DATA, sizeof(BACKGROUND_MUSIC_DATA)); + // auto pickup_sound = load_audio(PICKUP_SOUND_DATA, sizeof(PICKUP_SOUND_DATA)); + // auto hit_sound = load_audio(HIT_SOUND_DATA, sizeof(HIT_SOUND_DATA)); + registry.ctx().emplace(AudioAssets{ + .background_music = {.buffer = BACKGROUND_MUSIC_DATA, + .buffer_length = sizeof(BACKGROUND_MUSIC_DATA)}, + .pickup_sound = {.buffer = PICKUP_SOUND_DATA, .buffer_length = sizeof(PICKUP_SOUND_DATA)}, + .hit_sound = {.buffer = HIT_SOUND_DATA, .buffer_length = sizeof(HIT_SOUND_DATA)}}); + // registry.ctx().emplace(AudioAssets{.background_music = background_music, + // .pickup_sound = pickup_sound, + // .hit_sound = hit_sound}); - auto font = load_font(DEFAULT_FONT_DATA, sizeof(DEFAULT_FONT_DATA)); - registry.ctx().emplace(FontAssets{.default_font = font}); + // auto font = load_font(DEFAULT_FONT_DATA, sizeof(DEFAULT_FONT_DATA)); + // registry.ctx().emplace(FontAssets{.default_font = font}); } diff --git a/src/assets.hpp b/src/assets.hpp index 3eddaba..34aa3ee 100644 --- a/src/assets.hpp +++ b/src/assets.hpp @@ -2,8 +2,6 @@ #include "audio.hpp" -#include -#include #include struct TextureAtlasLayout @@ -16,7 +14,7 @@ struct TextureAtlasLayout struct Texture { - SDL_Texture* sdl_texture; + // SDL_Texture* sdl_texture; TextureAtlasLayout texture_atlas_layout; }; @@ -35,15 +33,15 @@ struct AudioAssets AudioAsset hit_sound; }; -struct FontAsset -{ - TTF_Font* font; -}; +// struct FontAsset +// { +// TTF_Font* font; +// }; -struct FontAssets -{ - FontAsset default_font; -}; +// struct FontAssets +// { +// FontAsset default_font; +// }; struct AssetModule { diff --git a/src/audio.cpp b/src/audio.cpp index 854c6f4..e36a4c1 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -3,29 +3,29 @@ AudioModule::AudioModule(entt::registry& registry) { - auto const& audio_assets = registry.ctx().get(); - auto* music_stream = SDL_OpenAudioDeviceStream( - SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audio_assets.background_music.spec, NULL, NULL); - auto* sound_stream = SDL_OpenAudioDeviceStream( - SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audio_assets.pickup_sound.spec, NULL, NULL); + // auto const& audio_assets = registry.ctx().get(); + // auto* music_stream = SDL_OpenAudioDeviceStream( + // SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audio_assets.background_music.spec, NULL, NULL); + // auto* sound_stream = SDL_OpenAudioDeviceStream( + // SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &audio_assets.pickup_sound.spec, NULL, NULL); - SDL_ResumeAudioStreamDevice(music_stream); - SDL_ResumeAudioStreamDevice(sound_stream); + // SDL_ResumeAudioStreamDevice(music_stream); + // SDL_ResumeAudioStreamDevice(sound_stream); - registry.ctx().emplace( - AudioStreams{.music_stream = music_stream, .sound_stream = sound_stream}); + // registry.ctx().emplace( + // AudioStreams{.music_stream = music_stream, .sound_stream = sound_stream}); } -void AudioModule::FeedAudioStreams(entt::registry& registry) -{ - auto audio_streams = registry.ctx().get(); - auto audio_assets = registry.ctx().get(); +// void AudioModule::FeedAudioStreams(entt::registry& registry) +// { +// auto audio_streams = registry.ctx().get(); +// auto audio_assets = registry.ctx().get(); - if (SDL_GetAudioStreamQueued(audio_streams.music_stream) < - static_cast(audio_assets.background_music.buffer_length)) - { - SDL_PutAudioStreamData(audio_streams.music_stream, - audio_assets.background_music.buffer, - audio_assets.background_music.buffer_length); - } -} +// if (SDL_GetAudioStreamQueued(audio_streams.music_stream) < +// static_cast(audio_assets.background_music.buffer_length)) +// { +// SDL_PutAudioStreamData(audio_streams.music_stream, +// audio_assets.background_music.buffer, +// audio_assets.background_music.buffer_length); +// } +// } diff --git a/src/audio.hpp b/src/audio.hpp index a95ad30..2ec94b3 100644 --- a/src/audio.hpp +++ b/src/audio.hpp @@ -1,24 +1,23 @@ #pragma once -#include #include #include struct AudioAsset { - SDL_AudioSpec spec; - uint8_t* buffer; + // SDL_AudioSpec spec; + uint8_t const* buffer; uint32_t buffer_length; }; -struct AudioStreams -{ - SDL_AudioStream* music_stream; - SDL_AudioStream* sound_stream; -}; +// struct AudioStreams +// { +// SDL_AudioStream* music_stream; +// SDL_AudioStream* sound_stream; +// }; struct AudioModule { AudioModule(entt::registry& registry); - static void FeedAudioStreams(entt::registry& registry); + // static void FeedAudioStreams(entt::registry& registry); }; diff --git a/src/definitions.hpp b/src/definitions.hpp index 4f0b21f..70076d1 100644 --- a/src/definitions.hpp +++ b/src/definitions.hpp @@ -1,18 +1,16 @@ #pragma once -#include -#include #include static constexpr int WINDOW_WIDTH = 400; static constexpr int WINDOW_HEIGHT = 240; -struct SdlHandles -{ - SDL_Window* window; - SDL_Renderer* renderer; - TTF_TextEngine* text_engine; -}; +// struct SdlHandles +// { +// SDL_Window* window; +// SDL_Renderer* renderer; +// TTF_TextEngine* text_engine; +// }; struct Game { diff --git a/src/input.hpp b/src/input.hpp index 3695389..ab4f797 100644 --- a/src/input.hpp +++ b/src/input.hpp @@ -1,11 +1,10 @@ #pragma once -#include #include struct ButtonInput { - std::set pressed; - std::set just_pressed; - std::set just_released; + std::set pressed; + std::set just_pressed; + std::set just_released; }; diff --git a/src/level.cpp b/src/level.cpp index 105a775..21a50a7 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -8,14 +8,14 @@ void LevelModule::MoveBasket(entt::registry& registry) for (auto [entity, pos, size, sprite] : basket_view.each()) { - if (input.pressed.contains(SDLK_LEFT)) - { - pos.x -= 5; - } - if (input.pressed.contains(SDLK_RIGHT)) - { - pos.x += 5; - } + // if (input.pressed.contains(SDLK_LEFT)) + // { + // pos.x -= 5; + // } + // if (input.pressed.contains(SDLK_RIGHT)) + // { + // pos.x += 5; + // } pos.x = pos.x < 0 ? 0 : pos.x; pos.x = pos.x > WINDOW_WIDTH - size.w ? WINDOW_WIDTH - size.w : pos.x; @@ -77,7 +77,7 @@ void LevelModule::SpawnFruits(entt::registry& registry) void LevelModule::CollectFruit(entt::registry& registry) { auto& game = registry.ctx().get(); - auto const& audio_streams = registry.ctx().get(); + // auto const& audio_streams = registry.ctx().get(); auto const& audio_assets = registry.ctx().get(); auto view = registry.view(); @@ -87,16 +87,16 @@ void LevelModule::CollectFruit(entt::registry& registry) pos.x += 1000; // registry.destroy(entity); - SDL_PutAudioStreamData(audio_streams.sound_stream, - audio_assets.pickup_sound.buffer, - audio_assets.pickup_sound.buffer_length); + // SDL_PutAudioStreamData(audio_streams.sound_stream, + // audio_assets.pickup_sound.buffer, + // audio_assets.pickup_sound.buffer_length); } } void LevelModule::CollectSpider(entt::registry& registry) { auto& game = registry.ctx().get(); - auto const& audio_streams = registry.ctx().get(); + // auto const& audio_streams = registry.ctx().get(); auto const& audio_assets = registry.ctx().get(); auto view = registry.view(); @@ -106,9 +106,9 @@ void LevelModule::CollectSpider(entt::registry& registry) pos.x += 1000; // registry.destroy(entity); - SDL_PutAudioStreamData(audio_streams.sound_stream, - audio_assets.hit_sound.buffer, - audio_assets.hit_sound.buffer_length); + // SDL_PutAudioStreamData(audio_streams.sound_stream, + // audio_assets.hit_sound.buffer, + // audio_assets.hit_sound.buffer_length); }; } diff --git a/src/main.cpp b/src/main.cpp index 464b086..5ab7032 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,60 +5,25 @@ #include "physics.hpp" #include "render.hpp" -#include -#include #include void increment_ticks(entt::registry& registry) { auto& game = registry.ctx().get(); - // auto& translate_system = registry.ctx().get(); - game.ticks += 1; - if (game.ticks % 60 == 0) + if (game.ticks % 60 == 0 && game.time > 0) { - game.time = std::max(0, game.time - 1); + game.time--; } - - // if (game.time == 0) - // translate_system.translate_system.disable(); } int main() { - // spdlog::info("Initialize SDL..."); - - SDL_SetHint(SDL_HINT_RENDER_VSYNC, "1"); - - if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) - { - // spdlog::critical("Failed to initialize SDL!\nCause: {}", SDL_GetError()); - std::terminate(); - } - - TTF_Init(); - - auto* window = SDL_CreateWindow("HansTheGatherer", WINDOW_WIDTH, WINDOW_HEIGHT, 0); - if (window == nullptr) - { - // spdlog::critical("Failed to create SDL window!\nCause: {}", SDL_GetError()); - } - - auto* renderer = SDL_CreateRenderer(window, nullptr); - if (renderer == nullptr) - { - // spdlog::critical("Failed to create SDL renderer!\nCause: {}", SDL_GetError()); - } - - auto* text_engine = TTF_CreateRendererTextEngine(renderer); - entt::registry registry; registry.ctx().emplace(Game{.ticks = 0, .time = 60, .score = 0, .random_engine = {}}); registry.ctx().emplace(ButtonInput{}); - auto sdl_handles = registry.ctx().emplace( - SdlHandles{.window = window, .renderer = renderer, .text_engine = text_engine}); AssetModule asset_module(registry); AudioModule audio_module(registry); @@ -76,34 +41,34 @@ int main() input->just_released.clear(); // Input - SDL_Event event; - while (SDL_PollEvent(&event)) - { - switch (event.type) - { - case SDL_EVENT_QUIT: - exit_gameloop = true; - break; - case SDL_EVENT_KEY_DOWN: - if (event.key.key == SDLK_ESCAPE) - { - exit_gameloop = true; - } - if (input->pressed.insert(event.key.key).second) - { - input->just_pressed.insert(event.key.key); - } - break; - case SDL_EVENT_KEY_UP: - if (input->pressed.erase(event.key.key) != 0) - { - input->just_released.insert(event.key.key); - } - break; - } - } + // SDL_Event event; + // while (SDL_PollEvent(&event)) + // { + // switch (event.type) + // { + // case SDL_EVENT_QUIT: + // exit_gameloop = true; + // break; + // case SDL_EVENT_KEY_DOWN: + // if (event.key.key == SDLK_ESCAPE) + // { + // exit_gameloop = true; + // } + // if (input->pressed.insert(event.key.key).second) + // { + // input->just_pressed.insert(event.key.key); + // } + // break; + // case SDL_EVENT_KEY_UP: + // if (input->pressed.erase(event.key.key) != 0) + // { + // input->just_released.insert(event.key.key); + // } + // break; + // } + // } - AudioModule::FeedAudioStreams(registry); + // AudioModule::FeedAudioStreams(registry); if (registry.ctx().get().time != 0) { @@ -120,15 +85,11 @@ int main() PhysicsModule::RemoveCollisionMarker(registry); PhysicsModule::CollisionCheck(registry); - SDL_RenderClear(sdl_handles.renderer); + // SDL_RenderClear(sdl_handles.renderer); RenderModule::RenderSprites(registry); RenderModule::RenderScore(registry); - SDL_RenderPresent(sdl_handles.renderer); + // SDL_RenderPresent(sdl_handles.renderer); } - SDL_DestroyRenderer(renderer); - SDL_DestroyWindow(window); - SDL_Quit(); - return 0; } diff --git a/src/render.cpp b/src/render.cpp index 6f0bf06..779221a 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -13,7 +13,7 @@ RenderModule::RenderModule(entt::registry& registry) void RenderModule::RenderSprites(entt::registry& registry) { - auto const& sdl_handles = registry.ctx().get(); + // auto const& sdl_handles = registry.ctx().get(); auto const& game = registry.ctx().get(); auto sprites_view = registry.view(entt::exclude); @@ -24,17 +24,17 @@ void RenderModule::RenderSprites(entt::registry& registry) TextureAtlasLayout layout = sprite.texture->texture_atlas_layout; uint8_t row = sprite.texture_atlas_index / layout.columns; uint8_t column = sprite.texture_atlas_index % layout.columns; - SDL_FRect srcrect{static_cast(column * layout.width), - static_cast(row * layout.height), - static_cast(layout.width), - static_cast(layout.height)}; + // SDL_FRect srcrect{static_cast(column * layout.width), + // static_cast(row * layout.height), + // static_cast(layout.width), + // static_cast(layout.height)}; - SDL_FRect dstrect{static_cast(pos.x), - static_cast(pos.y), - static_cast(size.w), - static_cast(size.h)}; + // SDL_FRect dstrect{static_cast(pos.x), + // static_cast(pos.y), + // static_cast(size.w), + // static_cast(size.h)}; - SDL_RenderTexture(sdl_handles.renderer, sprite.texture->sdl_texture, &srcrect, &dstrect); + // SDL_RenderTexture(sdl_handles.renderer, sprite.texture->sdl_texture, &srcrect, &dstrect); } for (auto [entity, pos, size, sprite] : sprites_view.each()) @@ -42,31 +42,31 @@ void RenderModule::RenderSprites(entt::registry& registry) TextureAtlasLayout layout = sprite.texture->texture_atlas_layout; uint8_t row = sprite.texture_atlas_index / layout.columns; uint8_t column = sprite.texture_atlas_index % layout.columns; - SDL_FRect srcrect{static_cast(column * layout.width), - static_cast(row * layout.height), - static_cast(layout.width), - static_cast(layout.height)}; + // SDL_FRect srcrect{static_cast(column * layout.width), + // static_cast(row * layout.height), + // static_cast(layout.width), + // static_cast(layout.height)}; - SDL_FRect dstrect{static_cast(pos.x), - static_cast(pos.y), - static_cast(size.w), - static_cast(size.h)}; + // SDL_FRect dstrect{static_cast(pos.x), + // static_cast(pos.y), + // static_cast(size.w), + // static_cast(size.h)}; - SDL_RenderTexture(sdl_handles.renderer, sprite.texture->sdl_texture, &srcrect, &dstrect); + // SDL_RenderTexture(sdl_handles.renderer, sprite.texture->sdl_texture, &srcrect, &dstrect); } } void RenderModule::RenderScore(entt::registry& registry) { - auto const& sdl_handles = registry.ctx().get(); + // auto const& sdl_handles = registry.ctx().get(); auto const& game = registry.ctx().get(); - auto const& font_assets = registry.ctx().get(); + // auto const& font_assets = registry.ctx().get(); auto score_string = std::format("Score: {}\nTime: {}", game.score, game.time); - auto text = TTF_CreateText(sdl_handles.text_engine, - font_assets.default_font.font, - score_string.c_str(), - score_string.length()); - TTF_DrawRendererText(text, 0.0, 0.0); - TTF_DestroyText(text); + // auto text = TTF_CreateText(sdl_handles.text_engine, + // font_assets.default_font.font, + // score_string.c_str(), + // score_string.length()); + // TTF_DrawRendererText(text, 0.0, 0.0); + // TTF_DestroyText(text); } \ No newline at end of file diff --git a/src/sprite.hpp b/src/sprite.hpp index b19e4a0..2717810 100644 --- a/src/sprite.hpp +++ b/src/sprite.hpp @@ -2,7 +2,6 @@ #include "assets.hpp" -#include #include struct Sprite