#pragma once

#include "math.h"
#include <GL/glew.h>

/*
The shape of a thing
*/
struct Mesh {
  u32 VAO, VBO, IBO;
  u32 index_count;

  Mesh();
  ~Mesh();
};

void create_mesh(Mesh *mesh, f32 *vertices, u32 *indices, u32 vertices_count, u32 indices_count);
void render_mesh(Mesh *mesh);
void clear_mesh(Mesh *mesh);
void calculate_normals_avg(f32 *vertices, u32 vertices_count, u32 vertices_length, u32 *indices, u32 indices_count, u32 normal_offset);

