From 4e146f2ef05ae4bd6d932c2b80878fc0a24bef2c Mon Sep 17 00:00:00 2001 From: dbr Date: Fri, 3 Mar 2023 18:57:01 +1030 Subject: [PATCH] fmt --- imgui-glow-renderer/src/lib.rs | 26 ++++++++++++++----- .../src/lib.rs | 15 ++++++++--- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/imgui-glow-renderer/src/lib.rs b/imgui-glow-renderer/src/lib.rs index a5911f8..c0131a3 100644 --- a/imgui-glow-renderer/src/lib.rs +++ b/imgui-glow-renderer/src/lib.rs @@ -285,9 +285,10 @@ impl Renderer { #[cfg(feature = "bind_vertex_array_support")] if self.gl_version.bind_vertex_array_support() { unsafe { - self.vertex_array_object = Some(gl - .create_vertex_array() - .map_err(|err| format!("Error creating vertex array object: {}", err))?); + self.vertex_array_object = Some( + gl.create_vertex_array() + .map_err(|err| format!("Error creating vertex array object: {}", err))?, + ); gl.bind_vertex_array(self.vertex_array_object); } } @@ -572,7 +573,9 @@ impl TextureMap for SimpleTextureMap { #[inline(always)] fn gl_texture(&self, imgui_texture: imgui::TextureId) -> Option { #[allow(clippy::cast_possible_truncation)] - Some(glow::NativeTexture(NonZeroU32::new(imgui_texture.id() as _).unwrap())) + Some(glow::NativeTexture( + NonZeroU32::new(imgui_texture.id() as _).unwrap(), + )) } } @@ -646,7 +649,10 @@ impl GlStateBackup { fn post_init(&mut self, gl: &Context) { #[allow(clippy::cast_sign_loss)] unsafe { - gl.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture)); + gl.bind_texture( + glow::TEXTURE_2D, + to_native_gl(self.texture, glow::NativeTexture), + ); } } @@ -705,7 +711,10 @@ impl GlStateBackup { #![allow(clippy::cast_sign_loss)] unsafe { gl.use_program(to_native_gl(self.program, glow::NativeProgram)); - gl.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture)); + gl.bind_texture( + glow::TEXTURE_2D, + to_native_gl(self.texture, glow::NativeTexture), + ); #[cfg(feature = "bind_sampler_support")] if let Some(sampler) = self.sampler { gl.bind_sampler(0, to_native_gl(sampler, glow::NativeSampler)); @@ -715,7 +724,10 @@ impl GlStateBackup { if let Some(vao) = self.vertex_array_object { gl.bind_vertex_array(to_native_gl(vao, glow::NativeVertexArray)); } - gl.bind_buffer(glow::ARRAY_BUFFER, to_native_gl(self.array_buffer, glow::NativeBuffer)); + gl.bind_buffer( + glow::ARRAY_BUFFER, + to_native_gl(self.array_buffer, glow::NativeBuffer), + ); gl.blend_equation_separate( self.blend_equation_rgb as _, self.blend_equation_alpha as _, diff --git a/imgui-winit-glow-renderer-viewports/src/lib.rs b/imgui-winit-glow-renderer-viewports/src/lib.rs index c71251e..5d3b13c 100644 --- a/imgui-winit-glow-renderer-viewports/src/lib.rs +++ b/imgui-winit-glow-renderer-viewports/src/lib.rs @@ -305,10 +305,19 @@ impl GlStateBackup { context.bind_vertex_array(to_native_gl(self.vao, glow::NativeVertexArray)); - context.bind_buffer(glow::ARRAY_BUFFER, to_native_gl(self.vbo, glow::NativeBuffer)); - context.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, to_native_gl(self.ibo, glow::NativeBuffer)); + context.bind_buffer( + glow::ARRAY_BUFFER, + to_native_gl(self.vbo, glow::NativeBuffer), + ); + context.bind_buffer( + glow::ELEMENT_ARRAY_BUFFER, + to_native_gl(self.ibo, glow::NativeBuffer), + ); - context.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture)); + context.bind_texture( + glow::TEXTURE_2D, + to_native_gl(self.texture, glow::NativeTexture), + ); context.active_texture(self.active_texture); context.use_program(to_native_gl(self.program, glow::NativeProgram));