This commit is contained in:
Able 2022-03-25 20:10:05 -05:00
parent b3ba2d582a
commit bbe069880c
4 changed files with 15 additions and 21 deletions

1
src/chunk.rs Normal file
View file

@ -0,0 +1 @@
pub struct Chunk {}

View file

@ -1,4 +1,6 @@
pub mod chunk;
pub mod platform; pub mod platform;
pub mod voxel;
pub struct Position3D { pub struct Position3D {
pub x: f64, pub x: f64,
@ -6,10 +8,6 @@ pub struct Position3D {
pub z: f64, pub z: f64,
} }
pub struct VoxelGrid {
pub name: String,
pub position: Position3D,
}
use bgfx::*; use bgfx::*;
use bgfx_rs::bgfx; use bgfx_rs::bgfx;
use glfw::{Action, Key, Window}; use glfw::{Action, Key, Window};
@ -38,7 +36,6 @@ fn main() {
panic!("failed to init bgfx"); panic!("failed to init bgfx");
} }
// bgfx::set_debug(DebugFlags::TEXT.bits());
bgfx::set_view_clear( bgfx::set_view_clear(
0, 0,
ClearFlags::COLOR.bits() | ClearFlags::DEPTH.bits(), ClearFlags::COLOR.bits() | ClearFlags::DEPTH.bits(),
@ -68,20 +65,6 @@ fn main() {
bgfx::set_view_rect(0, 0, 0, size.0 as _, size.1 as _); bgfx::set_view_rect(0, 0, 0, size.0 as _, size.1 as _);
bgfx::touch(0); bgfx::touch(0);
/*
bgfx::dbg_text_clear(DbgTextClearArgs::default());
bgfx::dbg_text(0, 1, 0x0f, "Color can be changed with ANSI \x1b[9;me\x1b[10;ms\x1b[11;mc\x1b[12;ma\x1b[13;mp\x1b[14;me\x1b[0m code too.");
bgfx::dbg_text(80, 1, 0x0f, "\x1b[;0m \x1b[;1m \x1b[; 2m \x1b[; 3m \x1b[; 4m \x1b[; 5m \x1b[; 6m \x1b[; 7m \x1b[0m");
bgfx::dbg_text(80, 2, 0x0f, "\x1b[;8m \x1b[;9m \x1b[;10m \x1b[;11m \x1b[;12m \x1b[;13m \x1b[;14m \x1b[;15m \x1b[0m");
bgfx::dbg_text(
0,
4,
0x3f,
"Description: Initialization and debug text with bgfx-rs Rust API.",
);
*/
bgfx::frame(false); bgfx::frame(false);
} }
shutdown_handler(); shutdown_handler();

View file

@ -1,5 +1,4 @@
use bgfx_rs::static_lib::PlatformData; use bgfx_rs::static_lib::{PlatformData, RendererType};
use bgfx_rs::static_lib::RendererType;
use glfw::Window; use glfw::Window;
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};

11
src/voxel.rs Normal file
View file

@ -0,0 +1,11 @@
use crate::{chunk::Chunk, Position3D};
pub struct VoxelData {
pub id: u32,
}
pub struct VoxelGrid {
pub name: String,
pub position: Position3D,
pub chunks: Vec<Chunk>,
}