fix names

This commit is contained in:
alexei-zebra 2026-10-10 12:34:52 +03:00
parent aac67ac93a
commit 714567a06e
No known key found for this signature in database
GPG key ID: D19D450AC3D9A80E
5 changed files with 16 additions and 16 deletions

View file

@ -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

View file

@ -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()

View file

@ -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<Input>
> 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)) {

View file

@ -11,7 +11,7 @@ struct DisplaySettings;
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
glfw_window_initialize(DisplaySettings* settings, std::string title);
#ifdef VOXELENGINE_WAYLAND
#ifdef VOXELCORE_WAYLAND
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
wayland_window_initialize(DisplaySettings* settings, std::string title);
#endif

View file

@ -4,7 +4,7 @@
#include <cstring>
#ifdef VOXELENGINE_SDBUS
#ifdef VOXELCORE_SDBUS
#include <systemd/sd-bus.h>
#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;