diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-15 00:06:07 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-15 00:06:07 +0200 |
commit | da329909f93597970afd169cee28ece3bee7127b (patch) | |
tree | b8ce428d458ab5e3e699334877253b10a62c8fe2 /engine/src/lib.rs | |
parent | 46f27f31e425f5eba494f499bd7a6ac8f8713c2a (diff) |
feat(engine): add logging OpenGL debug messages
Diffstat (limited to 'engine/src/lib.rs')
-rw-r--r-- | engine/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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<Self, Error> { - 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)?; |