Add render system

This commit is contained in:
Hugo Mårdbrink 2025-08-24 22:51:30 +02:00
parent af76df6a81
commit 05ba2a60d6
8 changed files with 395 additions and 330 deletions

45
ecs/components.odin Normal file
View file

@ -0,0 +1,45 @@
package ecs
import sg "../sokol/gfx"
Mat4 :: matrix[4, 4]f32
Vec2 :: [2]f32
Vec3 :: [3]f32
Vec4 :: [4]f32
Gravity :: struct {
force: Vec3
}
RigidBody :: struct {
velocity: Vec3,
acceleration: Vec3,
}
Transform :: struct {
position: Vec3,
rotation: Vec3,
scale: Vec3,
}
Color :: struct {
color: Vec4,
}
Mesh :: struct {
vertex_buffer: sg.Buffer,
index_buffer: sg.Buffer,
}
Material :: struct {
shader: sg.Shader,
image: sg.Image,
sampler: sg.Sampler,
}
Camera :: struct {
position: Vec3,
target: Vec3,
look: Vec2
}