30 lines
703 B
Plaintext
30 lines
703 B
Plaintext
// Application-facing graphics contracts only. No AGX implementation is included.
|
|
module agila
|
|
|
|
pub struct Vec2 { pub: x f32; y f32 }
|
|
pub struct Vec3 { pub: x f32; y f32; z f32 }
|
|
|
|
pub struct MeshDescriptor {
|
|
pub:
|
|
vertex_count int
|
|
index_count int
|
|
}
|
|
|
|
pub struct TextureDescriptor {
|
|
pub:
|
|
width int
|
|
height int
|
|
format string
|
|
}
|
|
|
|
pub fn validate_mesh(desc MeshDescriptor) ! {
|
|
if desc.vertex_count <= 0 || desc.index_count <= 0 {
|
|
return AgilaError{code: 20, message: 'Mesh counts must be positive'}
|
|
}
|
|
}
|
|
|
|
pub fn submit_mesh(desc MeshDescriptor) ! {
|
|
validate_mesh(desc)!
|
|
println('[Agila SDK sandbox graphics] submitted mesh ${desc.vertex_count}/${desc.index_count}')
|
|
}
|