#pragma once #include #include "types.h" struct default_shader_program { GLuint program_id; GLuint model_matrix_id; GLuint world_transform_id; GLuint view_matrix_id; GLuint projection_matrix_id; GLuint normal_matrix_id; GLuint vertex_array_id; GLuint sampler_id; GLuint num_lights_id; }; struct simple_shader_program { GLuint program_id; GLuint world_transform_id; GLuint MVP_id; GLuint vertex_array_id; }; struct shader_wrapper { shader_t shader_type; default_shader_program* default_shader; simple_shader_program* simple_shader; }; // TODO: find a way to initialize different shaders with different // uniform layouts with a single function // look at using uniform blocks and retrieving locations with // glGetUniformBlockIndex() and their size with glGetActiveUniformBlockiv() // see chapter 2 in the red book simple_shader_program* shaderInitSimple(const char* vertex_code, const char* frag_code); default_shader_program* shaderInitDefault(const char* vertex_code, const char* frag_code); void shaderFree(uint program_id);