Add render system
This commit is contained in:
parent
af76df6a81
commit
05ba2a60d6
8 changed files with 395 additions and 330 deletions
45
ecs/components.odin
Normal file
45
ecs/components.odin
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue