summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-11-10 15:05:45 -0500
committerFreya Murphy <freya@freyacat.org>2025-11-10 15:05:45 -0500
commitcaefd6a78323379cdd39339a4e792a19f0a494f0 (patch)
tree441984c300b1dd81ff40365386b20b5a3dec8bf7 /graphics
parentdungeon: new_unchecked should be unsafe (diff)
downloadDungeonCrawl-caefd6a78323379cdd39339a4e792a19f0a494f0.tar.gz
DungeonCrawl-caefd6a78323379cdd39339a4e792a19f0a494f0.tar.bz2
DungeonCrawl-caefd6a78323379cdd39339a4e792a19f0a494f0.zip
graphics: decouple sdl & wayland
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Cargo.toml2
-rw-r--r--graphics/src/lib.rs9
2 files changed, 10 insertions, 1 deletions
diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml
index 6f3be4e..bfc5554 100644
--- a/graphics/Cargo.toml
+++ b/graphics/Cargo.toml
@@ -16,5 +16,5 @@ workspace = true
[features]
default = []
-wayland = ["sdl", "raylib/wayland"]
+wayland = ["raylib/GLFW_BUILD_WAYLAND", "raylib/wayland"]
sdl = ["raylib/sdl"]
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs
index 811494c..25b4287 100644
--- a/graphics/src/lib.rs
+++ b/graphics/src/lib.rs
@@ -84,6 +84,15 @@ impl<'a> WindowBuilder<'a> {
builder.log_level(TraceLogLevel::LOG_WARNING);
}
+ // Set highdpi for wayland (this is only an issue for glfw)
+ // Rust binding to not make this accessable
+ #[cfg(feature = "wayland")]
+ #[cfg(not(feature = "sdl"))]
+ unsafe {
+ use ffi::ConfigFlags::*;
+ ffi::SetConfigFlags(FLAG_WINDOW_HIGHDPI as u32);
+ }
+
let (mut handle, thread) = builder.build();
if !handle.is_window_ready() {
return Err("Raylib window not ready!".into());