diff options
Diffstat (limited to 'src/core/shader.h')
-rw-r--r-- | src/core/shader.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/shader.h b/src/core/shader.h index 043ba1e..be3819f 100644 --- a/src/core/shader.h +++ b/src/core/shader.h @@ -24,13 +24,15 @@ typedef struct { void* userdata; } UniformCollection; -#define UTEX(i) (uniforms->var_tex[i]) -#define UM4(i) (&uniforms->var_mat4[i]) -#define UV2(i) (&uniforms->var_vec2[i]) -#define UV3(i) (&uniforms->var_vec3[i]) -#define UV4(i) (&uniforms->var_vec4[i]) -#define UN(i) (&uniforms->var_num[i]) -#define UU (uniforms->userdata) +extern UniformCollection* g_uniforms; + +#define UTEX(i) (g_uniforms->var_tex[i]) +#define UM4(i) (&g_uniforms->var_mat4[i]) +#define UV2(i) (&g_uniforms->var_vec2[i]) +#define UV3(i) (&g_uniforms->var_vec3[i]) +#define UV4(i) (&g_uniforms->var_vec4[i]) +#define UN(i) (&g_uniforms->var_num[i]) +#define UU (g_uniforms->userdata) #define REG_TOTAL 32 #define REG_NUM_COUNT 4 @@ -42,7 +44,7 @@ typedef struct { // Vertex* vertex; //} Vertex; -typedef void(*VertexShader)(UniformCollection* uniforms, Vertex* in, Vec4* homocoord); +typedef void(*VertexShader)(Vertex* in, Vec4* homocoord); typedef struct { float num[REG_NUM_COUNT]; @@ -51,7 +53,7 @@ typedef struct { Vec4 v4[REG_V4_COUNT]; } FragmentShaderIn; -typedef bool(*FragmentShader)(UniformCollection* uniforms, Color32* color); +typedef bool(*FragmentShader)(Color32* color); typedef struct { VertexShader vertexshader; |