fix missing depth buffer (like wtf)

This commit is contained in:
griffi-gh 2023-11-22 17:07:55 +01:00
parent d848f60301
commit 198dfb088e
2 changed files with 9 additions and 3 deletions

View file

@ -12,7 +12,9 @@ use glutin::{
context::ContextAttributesBuilder,
surface::{WindowSurface, SurfaceAttributesBuilder},
display::GetGlDisplay,
config::ConfigTemplateBuilder
};
use glutin_winit::DisplayBuilder;
use glam::{Vec3, UVec2};
use crate::{events::WindowResizedEvent, settings::{GameSettings, FullscreenMode}};
@ -90,8 +92,12 @@ impl Renderer {
});
// First we start by opening a new Window
let display_builder = glutin_winit::DisplayBuilder::new().with_window_builder(Some(wb));
let config_template_builder = glutin::config::ConfigTemplateBuilder::new();
let display_builder = DisplayBuilder::new().with_window_builder(Some(wb));
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
.build(event_loop, config_template_builder, |mut configs| {
configs.next().unwrap()

View file

@ -13,7 +13,7 @@ pub struct FullscreenSettings {
pub struct GameSettings {
pub vsync: bool,
pub fullscreen: Option<FullscreenSettings>,
pub msaa: Option<u16>,
pub msaa: Option<u8>,
pub max_anisotropy: Option<u16>,
/// there's a 1 chunk border of loaded but invisible around this
pub render_distance: u8,