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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user