app: refactor WindowContext name and creation

This commit is contained in:
Florian RICHER 2025-05-31 12:56:00 +02:00
parent a293b962f7
commit 45ccf030f6
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
6 changed files with 42 additions and 52 deletions

View file

@ -1,7 +1,7 @@
use std::error::Error;
use crate::core::app::DEPTH_IMAGE_ID;
use crate::core::app::context::ApplicationContext;
use crate::core::app::context::WindowContext;
use crate::core::app::user_event::UserEvent;
use crate::core::render::render_pass_manager::{RenderPassConfig, RenderPassManager};
use crate::core::scene::Scene;
@ -27,7 +27,7 @@ impl Scene for SettingsScene {
self.state.is_some()
}
fn load(&mut self, app_context: &mut ApplicationContext) -> Result<(), Box<dyn Error>> {
fn load(&mut self, app_context: &mut WindowContext) -> Result<(), Box<dyn Error>> {
let current_resolution = app_context.get_window_size();
let available_resolutions = app_context.get_available_resolutions();
@ -39,14 +39,14 @@ impl Scene for SettingsScene {
Ok(())
}
fn update(&mut self, _app_context: &mut ApplicationContext) -> Result<(), Box<dyn Error>> {
fn update(&mut self, _app_context: &mut WindowContext) -> Result<(), Box<dyn Error>> {
Ok(())
}
fn render(
&mut self,
before_future: Box<dyn GpuFuture>,
app_context: &mut ApplicationContext,
app_context: &mut WindowContext,
) -> Result<Box<dyn GpuFuture>, Box<dyn Error>> {
let state = self.state.as_ref().ok_or("State not found")?;