From 7edf3529db8e5c791eb82d1c508b790b9a4db100 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 10 Feb 2023 00:49:05 +0100 Subject: [PATCH] move assert_renderer to --- kubi/src/init.rs | 11 ++--------- kubi/src/main.rs | 3 ++- kubi/src/rendering.rs | 11 ++++++++++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/kubi/src/init.rs b/kubi/src/init.rs index ad6d2b2..6f35e85 100644 --- a/kubi/src/init.rs +++ b/kubi/src/init.rs @@ -1,17 +1,10 @@ -use shipyard::{AllStoragesView, NonSendSync, UniqueView}; -use glium::{Version, Api}; +use shipyard::AllStoragesView; use std::{env, net::SocketAddr}; use crate::{ networking::{GameType, ServerAddress}, - state::GameState, rendering::Renderer + state::GameState }; -pub fn assert_renderer( - renderer: NonSendSync> -) { - assert!(renderer.display.is_glsl_version_supported(&Version(Api::GlEs, 3, 0)), "GLES 3.0 is not supported"); -} - pub fn initialize_from_args( all_storages: AllStoragesView, ) { diff --git a/kubi/src/main.rs b/kubi/src/main.rs index 3505389..d0aeb98 100644 --- a/kubi/src/main.rs +++ b/kubi/src/main.rs @@ -57,6 +57,7 @@ use rendering::{ RenderTarget, BackgroundColor, clear_background, + assert_renderer, primitives::init_primitives, selection_box::render_selection_box, world::draw_world, @@ -67,7 +68,7 @@ use delta_time::{DeltaTime, init_delta_time}; use cursor_lock::{insert_lock_state, update_cursor_lock_state, lock_cursor_now}; use control_flow::{exit_on_esc, insert_control_flow_unique, SetControlFlow}; use state::{is_ingame, is_ingame_or_loading, is_loading}; -use init::{initialize_from_args, assert_renderer}; +use init::initialize_from_args; use gui::{render_gui, init_gui, gui_testing, update_gui}; fn startup() -> Workload { diff --git a/kubi/src/rendering.rs b/kubi/src/rendering.rs index 9389e76..e6d740c 100644 --- a/kubi/src/rendering.rs +++ b/kubi/src/rendering.rs @@ -1,6 +1,7 @@ use shipyard::{Unique, NonSendSync, UniqueView, UniqueViewMut}; use glium::{ - Display, Surface, + Display, Surface, + Version, Api, glutin::{ event_loop::EventLoop, window::WindowBuilder, @@ -34,10 +35,18 @@ impl Renderer { .with_gl_profile(GlProfile::Core); let display = Display::new(wb, cb, event_loop) .expect("Failed to create a glium Display"); + log::info!("renderer: {}", display.get_opengl_renderer_string()); + log::info!("oepngl {}", display.get_opengl_version_string()); Self { display } } } +pub fn assert_renderer( + renderer: NonSendSync> +) { + assert!(renderer.display.is_glsl_version_supported(&Version(Api::GlEs, 3, 0)), "GLES 3.0 is not supported"); +} + pub fn clear_background( mut target: NonSendSync>, color: UniqueView,