mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 16:28:42 -06:00
fix missing depth buffer (like wtf)
This commit is contained in:
parent
d848f60301
commit
198dfb088e
|
@ -12,7 +12,9 @@ use glutin::{
|
||||||
context::ContextAttributesBuilder,
|
context::ContextAttributesBuilder,
|
||||||
surface::{WindowSurface, SurfaceAttributesBuilder},
|
surface::{WindowSurface, SurfaceAttributesBuilder},
|
||||||
display::GetGlDisplay,
|
display::GetGlDisplay,
|
||||||
|
config::ConfigTemplateBuilder
|
||||||
};
|
};
|
||||||
|
use glutin_winit::DisplayBuilder;
|
||||||
use glam::{Vec3, UVec2};
|
use glam::{Vec3, UVec2};
|
||||||
use crate::{events::WindowResizedEvent, settings::{GameSettings, FullscreenMode}};
|
use crate::{events::WindowResizedEvent, settings::{GameSettings, FullscreenMode}};
|
||||||
|
|
||||||
|
@ -90,8 +92,12 @@ impl Renderer {
|
||||||
});
|
});
|
||||||
|
|
||||||
// First we start by opening a new Window
|
// First we start by opening a new Window
|
||||||
let display_builder = glutin_winit::DisplayBuilder::new().with_window_builder(Some(wb));
|
let display_builder = DisplayBuilder::new().with_window_builder(Some(wb));
|
||||||
let config_template_builder = glutin::config::ConfigTemplateBuilder::new();
|
let config_template_builder = ConfigTemplateBuilder::new()
|
||||||
|
.prefer_hardware_accelerated(Some(true))
|
||||||
|
.with_depth_size(24)
|
||||||
|
.with_multisampling(settings.msaa.unwrap_or_default())
|
||||||
|
.with_transparency(false);
|
||||||
let (window, gl_config) = display_builder
|
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()
|
configs.next().unwrap()
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub struct FullscreenSettings {
|
||||||
pub struct GameSettings {
|
pub struct GameSettings {
|
||||||
pub vsync: bool,
|
pub vsync: bool,
|
||||||
pub fullscreen: Option<FullscreenSettings>,
|
pub fullscreen: Option<FullscreenSettings>,
|
||||||
pub msaa: Option<u16>,
|
pub msaa: Option<u8>,
|
||||||
pub max_anisotropy: Option<u16>,
|
pub max_anisotropy: Option<u16>,
|
||||||
/// there's a 1 chunk border of loaded but invisible around this
|
/// there's a 1 chunk border of loaded but invisible around this
|
||||||
pub render_distance: u8,
|
pub render_distance: u8,
|
||||||
|
|
Loading…
Reference in a new issue