aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:21 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:21 +0100
commit9f6b7a10e7e00edf6ab50a9cf162b377d84a43f6 (patch)
treefe4ebd024c59376c425073b4fa747fa70824d171 /examples
parent26c325640df7ab8b9ea4a6c3fd5166f7df7f80ff (diff)
feat(render) WIP: textures, using a fixed size texture array
currently using an 8 long texture array with seperate samplers. also move to a trait for resolving textures from the bsp file rather than adding them manually. currently stuck with one static implementation though. this means all textures in the file are loaded when the map is. not currently drawing with anything other than the first texture array, so files with >8 textures will fail.
Diffstat (limited to 'examples')
-rw-r--r--examples/render-bsp/Cargo.toml1
-rw-r--r--examples/render-bsp/src/main.rs25
2 files changed, 14 insertions, 12 deletions
diff --git a/examples/render-bsp/Cargo.toml b/examples/render-bsp/Cargo.toml
index 666f035..b8b5a9d 100644
--- a/examples/render-bsp/Cargo.toml
+++ b/examples/render-bsp/Cargo.toml
@@ -8,5 +8,6 @@ stockton-render = { path = "../../stockton-render", features = ["vulkan"] }
stockton-types = { path = "../../stockton-types" }
stockton-levels = { path = "../../stockton-levels" }
winit = "^0.21"
+log = "0.4.0"
simple_logger = "1.0"
image = "0.23.2"
diff --git a/examples/render-bsp/src/main.rs b/examples/render-bsp/src/main.rs
index 51fc80f..0d81759 100644
--- a/examples/render-bsp/src/main.rs
+++ b/examples/render-bsp/src/main.rs
@@ -19,6 +19,7 @@ extern crate stockton_types;
extern crate stockton_levels;
extern crate stockton_render;
extern crate winit;
+extern crate log;
extern crate simple_logger;
extern crate image;
@@ -93,7 +94,7 @@ impl KeyState {
}
fn main() {
- simple_logger::init().unwrap();
+ simple_logger::init_with_level(log::Level::Debug).unwrap();
// Load the world and renderer
let event_loop = EventLoop::new();
@@ -112,17 +113,17 @@ fn main() {
let world = World::new(bsp);
let mut renderer = Renderer::new(world, &window).unwrap();
- {
- renderer.context.add_texture(
- load_from_memory(include_bytes!("../../render-quad/data/test1.png"))
- .expect("Couldn't load test texture 1")
- .into_rgba()).unwrap();
-
- renderer.context.add_texture(
- load_from_memory(include_bytes!("../../render-quad/data/test2.png"))
- .expect("Couldn't load test texture 2")
- .into_rgba()).unwrap();
- }
+ // {
+ // renderer.context.add_texture(
+ // load_from_memory(include_bytes!("../../render-quad/data/test1.png"))
+ // .expect("Couldn't load test texture 1")
+ // .into_rgba()).unwrap();
+
+ // renderer.context.add_texture(
+ // load_from_memory(include_bytes!("../../render-quad/data/test2.png"))
+ // .expect("Couldn't load test texture 2")
+ // .into_rgba()).unwrap();
+ // }
let mut last_update = SystemTime::now();
let mut key_state = KeyState::new();