From 9ed8f23f3d88bd63ce762d222bbd47ff493c598a Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 24 May 2024 22:58:38 +0200 Subject: feat(glfw): add support for samples window hint --- glfw/src/window.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/glfw/src/window.rs b/glfw/src/window.rs index 8ccb1d1..05878a8 100644 --- a/glfw/src/window.rs +++ b/glfw/src/window.rs @@ -401,7 +401,7 @@ impl Builder // Error is not checked for after since the two possible errors // (GLFW_NOT_INITIALIZED and GLFW_INVALID_ENUM) cannot occur. unsafe { - crate::ffi::glfwWindowHint(hint.to_glfw(), *value); + crate::ffi::glfwWindowHint(*hint as i32, *value); } } @@ -426,19 +426,11 @@ impl Builder /// Window creation hint #[derive(Debug, Clone, Copy)] +#[repr(i32)] pub enum Hint { - OpenGLDebugContext, -} - -impl Hint -{ - fn to_glfw(self) -> c_int - { - match self { - Self::OpenGLDebugContext => crate::ffi::GLFW_OPENGL_DEBUG_CONTEXT, - } - } + OpenGLDebugContext = crate::ffi::GLFW_OPENGL_DEBUG_CONTEXT, + Samples = crate::ffi::GLFW_SAMPLES, } /// Window size. -- cgit v1.2.3-18-g5258