Stop passing camera to create_graphics_pipeline

This commit is contained in:
Abdelrahman Said 2024-09-29 16:02:31 +01:00
parent cdb75019d2
commit deed9a42af

View File

@ -113,7 +113,7 @@ struct App {
int init (App &app);
void create_vertex_spec (Model &model, const std::vector<GLfloat> &vertices, const std::vector<GLuint> &indices);
void create_graphics_pipeline (Model &model, Camera &camera, const char *vs_file, const char *fs_file);
void create_graphics_pipeline (Model &model, const char *vs_file, const char *fs_file);
void run_main_loop (App &app);
void cleanup (App &app);
void render_model (const Model &model, const Camera &camera);
@ -179,9 +179,9 @@ int main() {
create_vertex_spec(app.plane, plane_vertices, plane_indices);
create_vertex_spec(app.floor, floor_vertices, floor_indices);
// Setup graphics pipeline. At the very minimum creating vertex and fragment shaders
create_graphics_pipeline(app.plane, app.camera, "shaders/vert.glsl", "shaders/frag.glsl");
create_graphics_pipeline(app.floor, app.camera, "shaders/vert.glsl", "shaders/frag.glsl");
// Setup graphics pipeline
create_graphics_pipeline(app.plane, "shaders/vert.glsl", "shaders/frag.glsl");
create_graphics_pipeline(app.floor, "shaders/vert.glsl", "shaders/frag.glsl");
run_main_loop(app);
@ -307,7 +307,7 @@ void create_vertex_spec(Model &model, const std::vector<GLfloat> &vertices, cons
model.mesh.vertices_count = indices.size();
}
void create_graphics_pipeline(Model &model, Camera &camera, const char *vs_file, const char *fs_file) {
void create_graphics_pipeline(Model &model, const char *vs_file, const char *fs_file) {
const std::string vs_source = load_shader(vs_file);
const std::string fs_source = load_shader(fs_file);