#pragma once #include #include "mesh.h" #include "render_object.h" #include "types.h" // TODO: having a separate code path for each shader is annoying and error // prone. could try using opaque pointers at high level (renderer, entity), // and then cast to the appropriate render_object/mesh/shader type in the lower // level functions based on the mesh_type property struct entity { glm::mat4 world_transform; // TODO: hide simple_mesh/mesh_group pointer behind abstraction simple_mesh* mesh; // TODO: should be a pointer into a global array of mesh_info(s) or // mesh_groups stored on the render_state object mesh_group meshes; render_objects* render_objs; }; bool entInitModel(entity& e, const char* model_path); bool entInitMesh(entity& e, simple_mesh* mesh, GLenum draw_mode); void entUpdateSimpleMesh(entity& e, simple_mesh* mesh, GLenum draw_mode); void entFree(entity& e); void entSetWorldPosition(entity& e, glm::vec3 v); void entTranslate(entity& e, glm::vec3 v); void entScale(entity& e, glm::vec3 v); void entRotate(entity& e, float angle, glm::vec3 axis);