#pragma once #include #include "gl_util.h" #include /// A piece of renderable geometry. /// /// The Geometry does not own its buffers, since buffers are typically shared /// to reduce the memory footprint and the number of draw calls. More generally, /// the renderer assumes ownership of all rendering resources, which simplifies /// their management. typedef struct Geometry { GLuint vao; GLenum mode; GeometryDesc desc; size_t num_verts; // May differ from the initial value in the descriptor if // the geometry is updated. GfxCore* gfxcore; } Geometry; /// Create new geometry. bool gfx_init_geometry(Geometry*, GfxCore*, const GeometryDesc*); /// Destroy the geometry. void gfx_del_geometry(Geometry*);