From f7210e4decaccf4f7dee7888c1b9ac2d3c20a124 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 21 Nov 2023 19:33:05 +0100 Subject: [PATCH] minor changes --- kubi/src/rendering.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kubi/src/rendering.rs b/kubi/src/rendering.rs index 4431346..6c0e960 100644 --- a/kubi/src/rendering.rs +++ b/kubi/src/rendering.rs @@ -7,7 +7,12 @@ use winit::{ dpi::PhysicalSize }; use glium::{Display, Surface, Version, Api}; -use glutin::{surface::WindowSurface, display::{GetGlDisplay, GlDisplay}, context::NotCurrentGlContext}; +use glutin::{ + prelude::*, + context::ContextAttributesBuilder, + surface::{WindowSurface, SurfaceAttributesBuilder}, + display::GetGlDisplay, +}; use glam::{Vec3, UVec2}; use crate::{events::WindowResizedEvent, settings::{GameSettings, FullscreenMode}}; @@ -88,7 +93,7 @@ impl Renderer { let display_builder = glutin_winit::DisplayBuilder::new().with_window_builder(Some(wb)); let config_template_builder = glutin::config::ConfigTemplateBuilder::new(); let (window, gl_config) = display_builder - .build(&event_loop, config_template_builder, |mut configs| { + .build(event_loop, config_template_builder, |mut configs| { configs.next().unwrap() }) .unwrap(); @@ -96,7 +101,7 @@ impl Renderer { // Now we get the window size to use as the initial size of the Surface let (width, height): (u32, u32) = window.inner_size().into(); - let attrs = glutin::surface::SurfaceAttributesBuilder::::new().build( + let attrs = SurfaceAttributesBuilder::::new().build( window.raw_window_handle(), NonZeroU32::new(width).unwrap(), NonZeroU32::new(height).unwrap(), @@ -104,7 +109,7 @@ impl Renderer { // Finally we can create a Surface, use it to make a PossiblyCurrentContext and create the glium Display let surface = unsafe { gl_config.display().create_window_surface(&gl_config, &attrs).unwrap() }; - let context_attributes = glutin::context::ContextAttributesBuilder::new().build(Some(window.raw_window_handle())); + let context_attributes = ContextAttributesBuilder::new().build(Some(window.raw_window_handle())); let current_context = unsafe { gl_config.display().create_context(&gl_config, &context_attributes).expect("failed to create context") }.make_current(&surface).unwrap();