diff --git a/README.md b/README.md index e13db2f44..41fcad58e 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ sudo pacman -S glfw glew glm libpng libvorbis openal luajit curl freetype2 opens On Linux the engine draws the window frame itself and needs `wayland-client`, `wayland-egl`, `wayland-scanner`, `wayland-protocols`, `libxkbcommon` and EGL. -Build with `-DVOXELENGINE_WAYLAND=OFF` to fall back to GLFW. +Build with `-DVOXELCORE_WAYLAND=OFF` to fall back to GLFW. ### Building engine with CMake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7cee11a0a..a50c63b82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -76,8 +76,8 @@ endif() target_include_directories(VoxelCoreSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -option(VOXELENGINE_WAYLAND "Build the native Wayland window backend" ON) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELENGINE_WAYLAND) +option(VOXELCORE_WAYLAND "Build the native Wayland window backend" ON) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELCORE_WAYLAND) find_package(PkgConfig REQUIRED) pkg_check_modules(wayland-client IMPORTED_TARGET wayland-client) pkg_check_modules(xkbcommon IMPORTED_TARGET xkbcommon) @@ -128,9 +128,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELENGINE_WAYLAND) target_sources( VoxelCoreSrc PRIVATE ${WAYLAND_SOURCES} ${wayland_sources}) target_include_directories(VoxelCoreSrc PRIVATE ${WAYLAND_GENERATED}) - target_compile_definitions(VoxelCoreSrc PRIVATE VOXELENGINE_WAYLAND=1) + target_compile_definitions(VoxelCoreSrc PRIVATE VOXELCORE_WAYLAND=1) if(libsystemd_FOUND) - target_compile_definitions(VoxelCoreSrc PUBLIC VOXELENGINE_SDBUS=1) + target_compile_definitions(VoxelCoreSrc PUBLIC VOXELCORE_SDBUS=1) target_link_libraries(VoxelCoreSrc PRIVATE PkgConfig::libsystemd) message(STATUS "Wayland backend: sd-bus settings are on") else() diff --git a/src/window/Window.cpp b/src/window/Window.cpp index e57535dec..9b9a39180 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -16,7 +16,7 @@ static debug::Logger logger("window"); -#ifdef VOXELENGINE_WAYLAND +#ifdef VOXELCORE_WAYLAND static bool prefer_wayland() { const char* display = getenv("WAYLAND_DISPLAY"); if (display != nullptr && *display) { @@ -31,7 +31,7 @@ std::tuple< std::unique_ptr > Window::initialize(DisplaySettings* settings, std::string title) { input_util::initialize(); -#ifdef VOXELENGINE_WAYLAND +#ifdef VOXELCORE_WAYLAND if (prefer_wayland()) { auto result = wayland_window_initialize(settings, title); if (std::get<0>(result) && std::get<1>(result)) { diff --git a/src/window/detail/WindowBackends.hpp b/src/window/detail/WindowBackends.hpp index 0d546c14c..873173040 100644 --- a/src/window/detail/WindowBackends.hpp +++ b/src/window/detail/WindowBackends.hpp @@ -11,7 +11,7 @@ struct DisplaySettings; std::tuple, std::unique_ptr> glfw_window_initialize(DisplaySettings* settings, std::string title); -#ifdef VOXELENGINE_WAYLAND +#ifdef VOXELCORE_WAYLAND std::tuple, std::unique_ptr> wayland_window_initialize(DisplaySettings* settings, std::string title); #endif diff --git a/src/window/wayland/WaylandSettings.cpp b/src/window/wayland/WaylandSettings.cpp index aeb2360b3..a36070220 100644 --- a/src/window/wayland/WaylandSettings.cpp +++ b/src/window/wayland/WaylandSettings.cpp @@ -4,7 +4,7 @@ #include -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS #include #endif @@ -13,7 +13,7 @@ namespace { constexpr const char* PORTAL_PATH = "/org/freedesktop/portal/desktop"; constexpr const char* PORTAL_INTERFACE = "org.freedesktop.portal.Settings"; -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS std::string readVariant(sd_bus_message* message) { const char* contents = nullptr; char type = 0; @@ -42,7 +42,7 @@ namespace { } struct SettingsWatcher::Impl { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS sd_bus* bus = nullptr; std::string changedKey; std::string changedValue; @@ -78,7 +78,7 @@ SettingsWatcher::~SettingsWatcher() { } bool SettingsWatcher::open() { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS if (impl->bus != nullptr) { return true; } @@ -97,7 +97,7 @@ bool SettingsWatcher::open() { } void SettingsWatcher::close() { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS if (impl->bus != nullptr) { sd_bus_flush_close_unref(impl->bus); impl->bus = nullptr; @@ -106,7 +106,7 @@ void SettingsWatcher::close() { } bool SettingsWatcher::isAvailable() const { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS return impl->bus != nullptr; #else return false; @@ -116,7 +116,7 @@ bool SettingsWatcher::isAvailable() const { bool SettingsWatcher::read( const char* schema, const char* key, std::string& value ) { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS if (impl->bus == nullptr) { return false; } @@ -150,7 +150,7 @@ bool SettingsWatcher::read( bool SettingsWatcher::poll( const char* schema, const char* key, std::string& value ) { -#ifdef VOXELENGINE_SDBUS +#ifdef VOXELCORE_SDBUS if (impl->bus == nullptr) { open(); return false;