mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-23 02:49:46 +00:00
fix names
This commit is contained in:
parent
aac67ac93a
commit
714567a06e
5 changed files with 16 additions and 16 deletions
|
|
@ -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`,
|
On Linux the engine draws the window frame itself and needs `wayland-client`,
|
||||||
`wayland-egl`, `wayland-scanner`, `wayland-protocols`, `libxkbcommon` and EGL.
|
`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
|
### Building engine with CMake
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@ endif()
|
||||||
|
|
||||||
target_include_directories(VoxelCoreSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(VoxelCoreSrc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
option(VOXELENGINE_WAYLAND "Build the native Wayland window backend" ON)
|
option(VOXELCORE_WAYLAND "Build the native Wayland window backend" ON)
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELENGINE_WAYLAND)
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELCORE_WAYLAND)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(wayland-client IMPORTED_TARGET wayland-client)
|
pkg_check_modules(wayland-client IMPORTED_TARGET wayland-client)
|
||||||
pkg_check_modules(xkbcommon IMPORTED_TARGET xkbcommon)
|
pkg_check_modules(xkbcommon IMPORTED_TARGET xkbcommon)
|
||||||
|
|
@ -128,9 +128,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELENGINE_WAYLAND)
|
||||||
target_sources(
|
target_sources(
|
||||||
VoxelCoreSrc PRIVATE ${WAYLAND_SOURCES} ${wayland_sources})
|
VoxelCoreSrc PRIVATE ${WAYLAND_SOURCES} ${wayland_sources})
|
||||||
target_include_directories(VoxelCoreSrc PRIVATE ${WAYLAND_GENERATED})
|
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)
|
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)
|
target_link_libraries(VoxelCoreSrc PRIVATE PkgConfig::libsystemd)
|
||||||
message(STATUS "Wayland backend: sd-bus settings are on")
|
message(STATUS "Wayland backend: sd-bus settings are on")
|
||||||
else()
|
else()
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
static debug::Logger logger("window");
|
static debug::Logger logger("window");
|
||||||
|
|
||||||
#ifdef VOXELENGINE_WAYLAND
|
#ifdef VOXELCORE_WAYLAND
|
||||||
static bool prefer_wayland() {
|
static bool prefer_wayland() {
|
||||||
const char* display = getenv("WAYLAND_DISPLAY");
|
const char* display = getenv("WAYLAND_DISPLAY");
|
||||||
if (display != nullptr && *display) {
|
if (display != nullptr && *display) {
|
||||||
|
|
@ -31,7 +31,7 @@ std::tuple<
|
||||||
std::unique_ptr<Input>
|
std::unique_ptr<Input>
|
||||||
> Window::initialize(DisplaySettings* settings, std::string title) {
|
> Window::initialize(DisplaySettings* settings, std::string title) {
|
||||||
input_util::initialize();
|
input_util::initialize();
|
||||||
#ifdef VOXELENGINE_WAYLAND
|
#ifdef VOXELCORE_WAYLAND
|
||||||
if (prefer_wayland()) {
|
if (prefer_wayland()) {
|
||||||
auto result = wayland_window_initialize(settings, title);
|
auto result = wayland_window_initialize(settings, title);
|
||||||
if (std::get<0>(result) && std::get<1>(result)) {
|
if (std::get<0>(result) && std::get<1>(result)) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ struct DisplaySettings;
|
||||||
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
|
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
|
||||||
glfw_window_initialize(DisplaySettings* settings, std::string title);
|
glfw_window_initialize(DisplaySettings* settings, std::string title);
|
||||||
|
|
||||||
#ifdef VOXELENGINE_WAYLAND
|
#ifdef VOXELCORE_WAYLAND
|
||||||
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
|
std::tuple<std::unique_ptr<Window>, std::unique_ptr<Input>>
|
||||||
wayland_window_initialize(DisplaySettings* settings, std::string title);
|
wayland_window_initialize(DisplaySettings* settings, std::string title);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
#include <systemd/sd-bus.h>
|
#include <systemd/sd-bus.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace {
|
||||||
constexpr const char* PORTAL_PATH = "/org/freedesktop/portal/desktop";
|
constexpr const char* PORTAL_PATH = "/org/freedesktop/portal/desktop";
|
||||||
constexpr const char* PORTAL_INTERFACE = "org.freedesktop.portal.Settings";
|
constexpr const char* PORTAL_INTERFACE = "org.freedesktop.portal.Settings";
|
||||||
|
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
std::string readVariant(sd_bus_message* message) {
|
std::string readVariant(sd_bus_message* message) {
|
||||||
const char* contents = nullptr;
|
const char* contents = nullptr;
|
||||||
char type = 0;
|
char type = 0;
|
||||||
|
|
@ -42,7 +42,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SettingsWatcher::Impl {
|
struct SettingsWatcher::Impl {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
sd_bus* bus = nullptr;
|
sd_bus* bus = nullptr;
|
||||||
std::string changedKey;
|
std::string changedKey;
|
||||||
std::string changedValue;
|
std::string changedValue;
|
||||||
|
|
@ -78,7 +78,7 @@ SettingsWatcher::~SettingsWatcher() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SettingsWatcher::open() {
|
bool SettingsWatcher::open() {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
if (impl->bus != nullptr) {
|
if (impl->bus != nullptr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -97,7 +97,7 @@ bool SettingsWatcher::open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWatcher::close() {
|
void SettingsWatcher::close() {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
if (impl->bus != nullptr) {
|
if (impl->bus != nullptr) {
|
||||||
sd_bus_flush_close_unref(impl->bus);
|
sd_bus_flush_close_unref(impl->bus);
|
||||||
impl->bus = nullptr;
|
impl->bus = nullptr;
|
||||||
|
|
@ -106,7 +106,7 @@ void SettingsWatcher::close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SettingsWatcher::isAvailable() const {
|
bool SettingsWatcher::isAvailable() const {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
return impl->bus != nullptr;
|
return impl->bus != nullptr;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -116,7 +116,7 @@ bool SettingsWatcher::isAvailable() const {
|
||||||
bool SettingsWatcher::read(
|
bool SettingsWatcher::read(
|
||||||
const char* schema, const char* key, std::string& value
|
const char* schema, const char* key, std::string& value
|
||||||
) {
|
) {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
if (impl->bus == nullptr) {
|
if (impl->bus == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ bool SettingsWatcher::read(
|
||||||
bool SettingsWatcher::poll(
|
bool SettingsWatcher::poll(
|
||||||
const char* schema, const char* key, std::string& value
|
const char* schema, const char* key, std::string& value
|
||||||
) {
|
) {
|
||||||
#ifdef VOXELENGINE_SDBUS
|
#ifdef VOXELCORE_SDBUS
|
||||||
if (impl->bus == nullptr) {
|
if (impl->bus == nullptr) {
|
||||||
open();
|
open();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue