Skip to content

Commit

Permalink
attempt to fix incorrect gl surface size (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed May 12, 2023
1 parent 4c33d89 commit 4082feb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,15 @@ impl Engine {
window.inner_size().height as f32,
));

#[cfg(not(target_arch = "wasm32"))]
gl_surface.resize(
&gl_context,
NonZeroU32::new(window.inner_size().width)
.unwrap_or_else(|| NonZeroU32::new(1).unwrap()),
NonZeroU32::new(window.inner_size().height)
.unwrap_or_else(|| NonZeroU32::new(1).unwrap()),
);

self.graphics_context = GraphicsContext::Initialized(InitializedGraphicsContext {
#[cfg(not(target_arch = "wasm32"))]
gl_context,
Expand Down

0 comments on commit 4082feb

Please sign in to comment.