mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 02:48:27 +00:00
Prepare for rendering list of operations
This commit is contained in:
parent
4c98cc736b
commit
0896ffdcbc
@ -111,12 +111,9 @@ impl ApplicationHandler for App {
|
||||
WindowEvent::RedrawRequested => {
|
||||
let selected_operation =
|
||||
self.ops.operations.get(self.selected_op);
|
||||
let last_operation = self.ops.operations.last();
|
||||
|
||||
if let (Some(selected), Some(last)) =
|
||||
(selected_operation, last_operation)
|
||||
{
|
||||
if let Err(err) = renderer.render(selected, last) {
|
||||
if let Some(selected) = selected_operation {
|
||||
if let Err(err) = renderer.render(selected, &self.ops) {
|
||||
eprintln!("Render error: {err}");
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
use anyhow::anyhow;
|
||||
use winit::window::Window;
|
||||
|
||||
use crate::geometry::Operation;
|
||||
use crate::geometry::{Operation, OpsLog};
|
||||
|
||||
use super::{geometry::Geometry, pipelines::Pipelines, text::TextRenderer};
|
||||
|
||||
@ -90,7 +90,7 @@ impl Renderer {
|
||||
pub fn render(
|
||||
&mut self,
|
||||
selected_operation: &impl Operation,
|
||||
last_operation: &impl Operation,
|
||||
last_operation: &OpsLog,
|
||||
) -> anyhow::Result<()> {
|
||||
let vertices = Geometry::vertices(&self.device, selected_operation);
|
||||
let triangles = Geometry::triangles(&self.device, selected_operation);
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::geometry::Operation;
|
||||
use crate::geometry::{Operation, OpsLog};
|
||||
|
||||
pub struct TextRenderer {
|
||||
text_atlas: glyphon::TextAtlas,
|
||||
@ -66,7 +66,7 @@ impl TextRenderer {
|
||||
queue: &wgpu::Queue,
|
||||
surface_config: &wgpu::SurfaceConfiguration,
|
||||
_selected_operation: &impl Operation,
|
||||
_last_operation: &impl Operation,
|
||||
_last_operation: &OpsLog,
|
||||
render_pass: &mut wgpu::RenderPass,
|
||||
) -> anyhow::Result<()> {
|
||||
let mut buffer = glyphon::Buffer::new(
|
||||
|
Loading…
Reference in New Issue
Block a user