Fixed the bug where different source files were referencing a static variable. Turns out static vars are internally linked, which means there was a separate static variable defined for each source. I could have fixed this issue by using extern (see https://stackoverflow.com/questions/10422034/when-to-use-extern-in-c), but instead went with just assigning the shader manually im main. This is becoming very messy and needs a cleanup.

This commit is contained in:
2025-08-22 15:09:34 -05:00
parent a79b074201
commit c961ccf7cd
4 changed files with 29 additions and 27 deletions

View File

@@ -4,8 +4,6 @@
#include <glm/glm.hpp>
#include "util.hpp"
static uint shader;
struct Body {
glm::mat4 pose;
float scale;
@@ -20,4 +18,4 @@ struct Body {
bool load_body(Body* out_body, const char* obj_filepath);
void draw_body(const Body& b);
void create_new_sphere(Body* b, float scale=1.0f);
void create_new_sphere(Body* b, float scale=1.0f);