aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/base.shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/base.shader.h')
-rw-r--r--src/libjin/Graphics/base.shader.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libjin/Graphics/base.shader.h b/src/libjin/Graphics/base.shader.h
index 0b8eca9..067a60b 100644
--- a/src/libjin/Graphics/base.shader.h
+++ b/src/libjin/Graphics/base.shader.h
@@ -1,3 +1,9 @@
+/*
+ * https://stackoverflow.com/questions/10868958/what-does-sampler2d-store
+ * The sampler2D is bound to a texture unit. The glUniform call binds it to texture
+ * unit zero. The glActiveTexture call is only needed if you are going to use multiple
+ * texture units (because GL_TEXTURE0 is the default anyway).
+*/
static const char* default_tex = "_tex0_";
@@ -21,13 +27,8 @@ void main()
gl_FragColor = effect(gl_Color, %s, gl_TexCoord[0].xy, gl_FragCoord.xy);
}
)";
+
+static const int SHADER_FORMAT_SIZE = strlen(base_shader) + strlen(default_tex) * 2;
+
#define formatShader(buf, program)\
sprintf(buf, base_shader, default_tex, program, default_tex)
-
-#define base_size (strlen(base_shader) + strlen(default_tex)*2)
-/*
- * https://stackoverflow.com/questions/10868958/what-does-sampler2d-store
- * The sampler2D is bound to a texture unit. The glUniform call binds it to texture
- * unit zero. The glActiveTexture call is only needed if you are going to use multiple
- * texture units (because GL_TEXTURE0 is the default anyway).
-*/ \ No newline at end of file