Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e146f2

Browse files
committed
fmt
1 parent b781572 commit 4e146f2

File tree

2 files changed

+31
-10
lines changed
  • imgui-glow-renderer/src
  • imgui-winit-glow-renderer-viewports/src

2 files changed

+31
-10
lines changed

imgui-glow-renderer/src/lib.rs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ impl Renderer {
285285
#[cfg(feature = "bind_vertex_array_support")]
286286
if self.gl_version.bind_vertex_array_support() {
287287
unsafe {
288-
self.vertex_array_object = Some(gl
289-
.create_vertex_array()
290-
.map_err(|err| format!("Error creating vertex array object: {}", err))?);
288+
self.vertex_array_object = Some(
289+
gl.create_vertex_array()
290+
.map_err(|err| format!("Error creating vertex array object: {}", err))?,
291+
);
291292
gl.bind_vertex_array(self.vertex_array_object);
292293
}
293294
}
@@ -572,7 +573,9 @@ impl TextureMap for SimpleTextureMap {
572573
#[inline(always)]
573574
fn gl_texture(&self, imgui_texture: imgui::TextureId) -> Option<glow::Texture> {
574575
#[allow(clippy::cast_possible_truncation)]
575-
Some(glow::NativeTexture(NonZeroU32::new(imgui_texture.id() as _).unwrap()))
576+
Some(glow::NativeTexture(
577+
NonZeroU32::new(imgui_texture.id() as _).unwrap(),
578+
))
576579
}
577580
}
578581

@@ -646,7 +649,10 @@ impl GlStateBackup {
646649
fn post_init(&mut self, gl: &Context) {
647650
#[allow(clippy::cast_sign_loss)]
648651
unsafe {
649-
gl.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture));
652+
gl.bind_texture(
653+
glow::TEXTURE_2D,
654+
to_native_gl(self.texture, glow::NativeTexture),
655+
);
650656
}
651657
}
652658

@@ -705,7 +711,10 @@ impl GlStateBackup {
705711
#![allow(clippy::cast_sign_loss)]
706712
unsafe {
707713
gl.use_program(to_native_gl(self.program, glow::NativeProgram));
708-
gl.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture));
714+
gl.bind_texture(
715+
glow::TEXTURE_2D,
716+
to_native_gl(self.texture, glow::NativeTexture),
717+
);
709718
#[cfg(feature = "bind_sampler_support")]
710719
if let Some(sampler) = self.sampler {
711720
gl.bind_sampler(0, to_native_gl(sampler, glow::NativeSampler));
@@ -715,7 +724,10 @@ impl GlStateBackup {
715724
if let Some(vao) = self.vertex_array_object {
716725
gl.bind_vertex_array(to_native_gl(vao, glow::NativeVertexArray));
717726
}
718-
gl.bind_buffer(glow::ARRAY_BUFFER, to_native_gl(self.array_buffer, glow::NativeBuffer));
727+
gl.bind_buffer(
728+
glow::ARRAY_BUFFER,
729+
to_native_gl(self.array_buffer, glow::NativeBuffer),
730+
);
719731
gl.blend_equation_separate(
720732
self.blend_equation_rgb as _,
721733
self.blend_equation_alpha as _,

imgui-winit-glow-renderer-viewports/src/lib.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,19 @@ impl GlStateBackup {
305305

306306
context.bind_vertex_array(to_native_gl(self.vao, glow::NativeVertexArray));
307307

308-
context.bind_buffer(glow::ARRAY_BUFFER, to_native_gl(self.vbo, glow::NativeBuffer));
309-
context.bind_buffer(glow::ELEMENT_ARRAY_BUFFER, to_native_gl(self.ibo, glow::NativeBuffer));
308+
context.bind_buffer(
309+
glow::ARRAY_BUFFER,
310+
to_native_gl(self.vbo, glow::NativeBuffer),
311+
);
312+
context.bind_buffer(
313+
glow::ELEMENT_ARRAY_BUFFER,
314+
to_native_gl(self.ibo, glow::NativeBuffer),
315+
);
310316

311-
context.bind_texture(glow::TEXTURE_2D, to_native_gl(self.texture, glow::NativeTexture));
317+
context.bind_texture(
318+
glow::TEXTURE_2D,
319+
to_native_gl(self.texture, glow::NativeTexture),
320+
);
312321
context.active_texture(self.active_texture);
313322

314323
context.use_program(to_native_gl(self.program, glow::NativeProgram));

0 commit comments

Comments
 (0)