Refactoring: Rename SDL wrapper funcs to snake_case

This commit is contained in:
Lexi / Zoe 2026-05-10 23:33:59 +02:00
parent 7f37be386d
commit 7b8aac69fb
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
5 changed files with 17 additions and 17 deletions

View file

@ -25,16 +25,16 @@ export namespace rutile
{ {
try { try {
// Set SDL application metadata // Set SDL application metadata
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, config::app_name); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_NAME_STRING, config::app_name);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, config::app_version); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_VERSION_STRING, config::app_version);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING, config::app_identifier); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_IDENTIFIER_STRING, config::app_identifier);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_CREATOR_STRING, config::app_creator); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_CREATOR_STRING, config::app_creator);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING, config::app_copyright); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_COPYRIGHT_STRING, config::app_copyright);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_URL_STRING, config::app_url); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_URL_STRING, config::app_url);
sdl::SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, "game"); sdl::set_app_metadata_property(SDL_PROP_APP_METADATA_TYPE_STRING, "game");
// Initialize SDL subsystems // Initialize SDL subsystems
sdl::Init(sdl::InitFlags::Video | sdl::InitFlags::Events); sdl::initialize_sdl(sdl::InitFlags::Video | sdl::InitFlags::Events);
// Create engine (includes window and renderer) and game state // Create engine (includes window and renderer) and game state
engine_ = Engine::create(); engine_ = Engine::create();

View file

@ -52,7 +52,7 @@ export namespace rutile
// Prevent the class from being instantiated multiple times // Prevent the class from being instantiated multiple times
assert(!instantiated_); assert(!instantiated_);
auto [sdl_window, sdl_renderer] = sdl::CreateWindowAndRenderer( auto [sdl_window, sdl_renderer] = sdl::create_window_and_renderer(
config::get_window_title(), config::get_window_title(),
config::window_width, config::window_width,
config::window_height, config::window_height,

View file

@ -2,7 +2,7 @@ module;
#include <format> #include <format>
#include <stdexcept> #include <stdexcept>
#include <SDL3/SDL.h> #include <SDL3/SDL_error.h>
export module wrappers.sdl.error; export module wrappers.sdl.error;

View file

@ -1,7 +1,7 @@
module; module;
#include <type_traits> #include <type_traits>
#include <SDL3/SDL.h> #include <SDL3/SDL_init.h>
export module wrappers.sdl.init; export module wrappers.sdl.init;
@ -31,7 +31,7 @@ export namespace sdl
} }
/** /**
* Wrapper around the SDL_AppResult enum. * Wrapper for the SDL_AppResult enum.
*/ */
enum class AppResult : std::underlying_type_t<SDL_AppResult> enum class AppResult : std::underlying_type_t<SDL_AppResult>
{ {
@ -41,9 +41,9 @@ export namespace sdl
}; };
/** /**
* Wrapper around SDL_Init(). * Wrapper for SDL_Init().
*/ */
constexpr void Init(const InitFlags_t flags) constexpr void initialize_sdl(const InitFlags_t flags)
{ {
if (!SDL_Init(flags)) { if (!SDL_Init(flags)) {
throw SDLException("SDL_Init"); throw SDLException("SDL_Init");
@ -51,9 +51,9 @@ export namespace sdl
} }
/** /**
* Wrapper around SDL_SetAppMetadataProperty(). * Wrapper for SDL_SetAppMetadataProperty().
*/ */
constexpr void SetAppMetadataProperty(const char* property_name, const char* value) constexpr void set_app_metadata_property(const char* property_name, const char* value)
{ {
if (!SDL_SetAppMetadataProperty(property_name, value)) { if (!SDL_SetAppMetadataProperty(property_name, value)) {
throw SDLException("SDL_SetAppMetadataProperty"); throw SDLException("SDL_SetAppMetadataProperty");

View file

@ -173,7 +173,7 @@ export namespace sdl
* Returns a pair of a Window and a Renderer object. * Returns a pair of a Window and a Renderer object.
* Throws an SDLException on failure. * Throws an SDLException on failure.
*/ */
std::pair<Window, Renderer> CreateWindowAndRenderer( std::pair<Window, Renderer> create_window_and_renderer(
const std::string& title, const std::string& title,
const int width, const int width,
const int height, const int height,