From 5e4a2c8fa58f30a93506c1db21aa7a9921c0affc Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 7 Sep 2018 00:27:46 +0800 Subject: *format source code --- src/libjin/Graphics/base.shader.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/libjin/Graphics/base.shader.h') 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 -- cgit v1.1-26-g67d0