diff --git a/ecs/camera_system.odin b/ecs/camera_system.odin index 2172bae..c484ec1 100644 --- a/ecs/camera_system.odin +++ b/ecs/camera_system.odin @@ -3,8 +3,6 @@ package ecs import "core:math" import "core:math/linalg" -import sa "../sokol/app" - CameraSystem :: struct { using base: SystemBase, } @@ -19,8 +17,6 @@ camera_system_update :: proc(camera_system: ^CameraSystem, coordinator: ^Coordin camera := coordinator_get_component(CameraComponent, coordinator, entity) input := coordinator_get_component(InputComponent, coordinator, entity) - if input.key_down[.ESCAPE] do sa.quit() - move_input: Vec3 if input.key_down[.W] do move_input.y = 1 else if input.key_down[.S] do move_input.y = -1 diff --git a/ecs/input_system.odin b/ecs/input_system.odin index 386a47e..b09fc96 100644 --- a/ecs/input_system.odin +++ b/ecs/input_system.odin @@ -18,6 +18,8 @@ input_system_update :: proc(input_system: ^InputSystem, coordinator: ^Coordinato case .KEY_UP: input.key_down[event.key_code] = false } + + if input.key_down[.ESCAPE] do sa.quit() } } diff --git a/ecs/render_system.odin b/ecs/render_system.odin index 9758bb7..e32f800 100644 --- a/ecs/render_system.odin +++ b/ecs/render_system.odin @@ -70,6 +70,7 @@ init_outline_material :: proc(render_system: ^RenderSystem) { bias_slope_scale = 1.0, compare = .LESS_EQUAL, }, + sample_count = 4, }) sampler := sg.make_sampler({}) @@ -102,6 +103,7 @@ init_cube_material :: proc(render_system: ^RenderSystem) { bias_slope_scale = 1.0, compare = .LESS_EQUAL, }, + sample_count = 4, }) w, h: i32 @@ -122,7 +124,7 @@ init_cube_material :: proc(render_system: ^RenderSystem) { } } } - } + }, }) sampler := sg.make_sampler({}) diff --git a/main.odin b/main.odin index 78524a8..e76e7f6 100644 --- a/main.odin +++ b/main.odin @@ -140,6 +140,7 @@ create_cube :: proc() { rotation = ecs.Vec3{ 0.0, 0.0, 0.0 }, scale = ecs.Vec3{ 1.0, 1.0, 1.0 }, }) + ecs.coordinator_add_component( ecs.ColorComponent, &g.coordinator, @@ -223,7 +224,7 @@ create_scene :: proc() { ecs.InputComponent{ key_down = {}, mouse_movement = Vec2{ 0, 0 } - }) + }) ecs.render_system_init(g.render_system, user_entity) }