From da329909f93597970afd169cee28ece3bee7127b Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 Oct 2023 00:06:07 +0200 Subject: feat(engine): add logging OpenGL debug messages --- engine/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engine/src/lib.rs') diff --git a/engine/src/lib.rs b/engine/src/lib.rs index 407df32..dc76b37 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -29,7 +29,13 @@ impl Engine /// Will return `Err` if window creation or window configuration fails. pub fn new(window_size: &WindowSize, window_title: &str) -> Result { - let window = WindowBuilder::new() + let window_builder = WindowBuilder::new(); + + #[cfg(feature = "debug")] + let window_builder = + window_builder.hint(glfw::window::Hint::OpenGLDebugContext, 1); + + let window = window_builder .create(window_size, window_title) .map_err(Error::CreateWindowFailed)?; -- cgit v1.2.3-18-g5258