Skip to content

Commit ab1dd4d

Browse files
committed
Fix non-OpenGL build
1 parent 5a4c7c2 commit ab1dd4d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ rust-version = "1.82"
2525
[features]
2626
default = []
2727
opengl = [
28+
"windows/Win32_Graphics_OpenGL",
29+
"windows-sys/Win32_Graphics_OpenGL",
2830
"objc2-core-foundation/CFBundle",
2931
"objc2-app-kit/NSOpenGL",
3032
"objc2-app-kit/NSOpenGLView",
@@ -47,15 +49,13 @@ bytemuck = "1.25.0"
4749
[target.'cfg(target_os="windows")'.dependencies]
4850
windows = { version = "0.62.2", features = [
4951
"Win32_Graphics_Gdi",
50-
"Win32_Graphics_OpenGL",
5152
"Win32_System_Com_StructuredStorage",
5253
"Win32_System_Ole",
5354
"Win32_System_SystemServices",
5455
"Win32_UI_WindowsAndMessaging",
5556
] }
5657
windows-sys = { version = "0.61.2", features = [
5758
"Win32_Graphics_Gdi",
58-
"Win32_Graphics_OpenGL",
5959
"Win32_System_Rpc",
6060
"Win32_System_LibraryLoader",
6161
"Win32_System_Ole",

src/wrappers/win32/window/handle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::wrappers::win32::style::WindowStyle;
22
use crate::wrappers::win32::user32::ExtendedUser32;
3-
use crate::wrappers::win32::window::OwnDeviceContext;
43
use crate::wrappers::win32::{Dpi, DpiAwarenessContext, Rect};
54
use dpi::{PhysicalPosition, PhysicalSize};
65
use std::ffi::c_void;
@@ -259,7 +258,8 @@ impl HWnd {
259258
Ok(PhysicalPosition::new(pt.x, pt.y))
260259
}
261260

262-
pub fn get_own_dc(&self) -> Result<OwnDeviceContext> {
263-
OwnDeviceContext::from_window(*self)
261+
#[cfg(feature = "opengl")]
262+
pub fn get_own_dc(&self) -> Result<super::OwnDeviceContext> {
263+
super::OwnDeviceContext::from_window(*self)
264264
}
265265
}

0 commit comments

Comments
 (0)