mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Move into render module
This commit is contained in:
parent
727fb4d614
commit
3f4beab87f
11
src/main.rs
11
src/main.rs
@ -3,20 +3,13 @@ use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEve
|
||||
use winit::event_loop::{ControlFlow, EventLoop};
|
||||
use winit::window::{Window, WindowBuilder};
|
||||
|
||||
use crate::state::State;
|
||||
use crate::render::state::State;
|
||||
|
||||
mod fps_meter;
|
||||
mod multisampling;
|
||||
mod piplines;
|
||||
mod shader;
|
||||
mod shader_ffi;
|
||||
mod state;
|
||||
mod tesselation;
|
||||
mod texture;
|
||||
|
||||
mod platform_constants;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod web;
|
||||
mod render;
|
||||
|
||||
async fn setup(window: Window, event_loop: EventLoop<()>) {
|
||||
info!("== mapr ==");
|
||||
|
||||
9
src/render/mod.rs
Normal file
9
src/render/mod.rs
Normal file
@ -0,0 +1,9 @@
|
||||
mod multisampling;
|
||||
mod piplines;
|
||||
mod shader;
|
||||
mod shader_ffi;
|
||||
mod tesselation;
|
||||
mod texture;
|
||||
mod platform_constants;
|
||||
|
||||
pub mod state;
|
||||
@ -1,7 +1,7 @@
|
||||
use wgpu::{ColorTargetState, FragmentState, ShaderModule, ShaderModuleDescriptor, VertexAttribute, VertexBufferLayout, VertexState};
|
||||
use crate::platform_constants::COLOR_TEXTURE_FORMAT;
|
||||
use super::platform_constants::COLOR_TEXTURE_FORMAT;
|
||||
|
||||
use crate::shader_ffi::GpuVertex;
|
||||
use super::shader_ffi::GpuVertex;
|
||||
|
||||
const MAP_VERTEX_SHADER_ARGUMENTS: [VertexAttribute; 3] = [
|
||||
wgpu::VertexAttribute {
|
||||
@ -12,13 +12,13 @@ use winit::event::{ElementState, KeyboardInput, VirtualKeyCode, WindowEvent};
|
||||
use winit::window::Window;
|
||||
|
||||
use crate::fps_meter::FPSMeter;
|
||||
use crate::multisampling::create_multisampled_framebuffer;
|
||||
use crate::piplines::*;
|
||||
use crate::platform_constants::{COLOR_TEXTURE_FORMAT, MIN_BUFFER_SIZE};
|
||||
use crate::shader::*;
|
||||
use crate::shader_ffi::*;
|
||||
use crate::tesselation::{RustLogo, Tesselated};
|
||||
use crate::texture::Texture;
|
||||
use super::multisampling::create_multisampled_framebuffer;
|
||||
use super::piplines::*;
|
||||
use super::platform_constants::{COLOR_TEXTURE_FORMAT, MIN_BUFFER_SIZE};
|
||||
use super::shader::*;
|
||||
use super::shader_ffi::*;
|
||||
use super::tesselation::{RustLogo, Tesselated};
|
||||
use super::texture::Texture;
|
||||
|
||||
pub struct SceneParams {
|
||||
pub target_zoom: f32,
|
||||
@ -75,7 +75,7 @@ pub struct State {
|
||||
scene: SceneParams,
|
||||
}
|
||||
|
||||
const TEST_TILES: &[u8] = include_bytes!("../test-data/12-2176-1425.pbf");
|
||||
const TEST_TILES: &[u8] = include_bytes!("../../test-data/12-2176-1425.pbf");
|
||||
|
||||
impl State {
|
||||
pub async fn new(window: &Window) -> Self {
|
||||
@ -10,7 +10,7 @@ use lyon_path::Path;
|
||||
use vector_tile::geometry::{Command, Geometry};
|
||||
use vector_tile::tile::Tile;
|
||||
|
||||
use crate::shader_ffi::GpuVertex;
|
||||
use super::shader_ffi::GpuVertex;
|
||||
|
||||
const DEFAULT_TOLERANCE: f32 = 0.02;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user