mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 16:28:42 -06:00
assert renderer in init stage
This commit is contained in:
parent
54004ee5de
commit
06e94ccb46
|
@ -57,7 +57,6 @@ use rendering::{
|
|||
RenderTarget,
|
||||
BackgroundColor,
|
||||
clear_background,
|
||||
assert_renderer,
|
||||
primitives::init_primitives,
|
||||
selection_box::render_selection_box,
|
||||
world::draw_world,
|
||||
|
@ -73,7 +72,6 @@ use gui::{render_gui, init_gui, gui_testing, update_gui};
|
|||
|
||||
fn startup() -> Workload {
|
||||
(
|
||||
assert_renderer,
|
||||
initial_resize_event,
|
||||
load_settings,
|
||||
load_prefabs,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use shipyard::{Unique, NonSendSync, UniqueView, UniqueViewMut};
|
||||
use shipyard::{Unique, NonSendSync, UniqueView, UniqueViewMut, AllStoragesView};
|
||||
use glium::{
|
||||
Display, Surface,
|
||||
Version, Api,
|
||||
|
@ -35,18 +35,14 @@ 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());
|
||||
log::info!("Renderer: {}", display.get_opengl_renderer_string());
|
||||
log::info!("OpenGL {}", display.get_opengl_version_string());
|
||||
log::info!("Supports GLES {:?}", display.get_supported_glsl_version());
|
||||
assert!(display.is_glsl_version_supported(&Version(Api::GlEs, 3, 0)), "GLES 3.0 is not supported");
|
||||
Self { display }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn assert_renderer(
|
||||
renderer: NonSendSync<UniqueView<Renderer>>
|
||||
) {
|
||||
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<UniqueViewMut<RenderTarget>>,
|
||||
color: UniqueView<BackgroundColor>,
|
||||
|
|
Loading…
Reference in a new issue