Skip to content

Commit

Permalink
feat: add new basic structures
Browse files Browse the repository at this point in the history
  • Loading branch information
imrn99 committed May 3, 2024
1 parent bb96532 commit 978fc56
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion honeycomb-core/src/attributes/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ mod tests {
}

#[test]
#[should_panic(expected = "assertion failed: tmp.is_none()")]
#[should_panic(expected = "assertion failed: state.is_none()")]
fn sparse_vec_insert_already_existing() {
generate_sparse!(storage);
assert_eq!(storage.get(&3), &Some(Temperature::from(279.0)));
Expand Down
2 changes: 1 addition & 1 deletion honeycomb-render/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use winit::event::{Event, WindowEvent};
use winit::event_loop::EventLoop;
use winit::window::{Window, WindowAttributes};

use crate::state::State;
use crate::tmp::State;
use crate::RenderParameters;
use honeycomb_core::{CMap2, CoordsFloat};

Expand Down
12 changes: 12 additions & 0 deletions honeycomb-render/src/state/app.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! mod doc

use crate::handle::CMap2RenderHandle;
use crate::state::gfx::GfxState;
use honeycomb_core::CoordsFloat;
use winit::window::Window;

pub struct App<'a, T: CoordsFloat> {
pub(crate) window: Option<Window>,
pub(crate) gfx: Option<GfxState>,
pub(crate) map_handle: Option<CMap2RenderHandle<'a, T>>,
}
21 changes: 21 additions & 0 deletions honeycomb-render/src/state/gfx.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! mod doc

use crate::camera::{Camera, CameraController, CameraUniform};
use winit::dpi::PhysicalSize;

pub struct GfxState {
surface: wgpu::Surface<'static>,
device: wgpu::Device,
queue: wgpu::Queue,
config: wgpu::SurfaceConfiguration,
size: PhysicalSize<u32>,
render_pipeline: wgpu::RenderPipeline,
vertex_buffer: wgpu::Buffer,
num_vertices: u32,
camera: Camera,
camera_uniform: CameraUniform,
camera_buffer: wgpu::Buffer,
camera_bind_group: wgpu::BindGroup,
camera_controller: CameraController,
smaa_target: smaa::SmaaTarget,
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// ------ IMPORTS

mod app;
mod gfx;

// intern
use crate::camera::{Camera, CameraController, CameraUniform, SPEED_FACTOR};
use crate::handle::CMap2RenderHandle;
Expand Down

0 comments on commit 978fc56

Please sign in to comment.