Search
lxdream.org :: lxdream/src/tools/genglsl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/tools/genglsl.c
changeset 1209:e606e65eaf54
prev1208:6955202d6408
next1229:dc935eee9767
author nkeynes
date Tue Feb 07 11:59:07 2012 +1000 (7 years ago)
permissions -rw-r--r--
last change Add enable/disable vertex attribute calls when making a shader active
Add vec3 uniform setter
file annotate diff log raw
1.1 --- a/src/tools/genglsl.c Tue Feb 07 11:44:19 2012 +1000
1.2 +++ b/src/tools/genglsl.c Tue Feb 07 11:59:07 2012 +1000
1.3 @@ -317,6 +317,9 @@
1.4 fprintf( f, "void glsl_set_%s_%s(%s value); /* uniform %s %s */ \n", program->name, var->name, getCType(var->type,var->uniform), var->type, var->name );
1.5 } else {
1.6 fprintf( f, "void glsl_set_%s_%s_pointer(%s ptr, GLint stride); /* attribute %s %s */ \n", program->name, var->name, getCType(var->type,var->uniform), var->type, var->name);
1.7 + if( strcmp(var->type,"vec4") == 0 ) { /* Special case */
1.8 + fprintf( f, "void glsl_set_%s_%s_vec3_pointer(%s ptr, GLint stride); /* attribute %s %s */ \n", program->name, var->name, getCType(var->type,var->uniform), var->type, var->name);
1.9 + }
1.10 }
1.11 }
1.12 }
1.13 @@ -402,6 +405,10 @@
1.14 } else {
1.15 fprintf( f, "void glsl_set_%s_%s_pointer(%s ptr, GLsizei stride){ /* attribute %s %s */ \n", program->name, var->name, getCType(var->type,var->uniform), var->type, var->name);
1.16 fprintf( f, " glsl_set_attrib_%s(var_%s_%s_loc,stride, ptr);\n}\n", var->type, program->name, var->name );
1.17 + if( strcmp(var->type,"vec4") == 0 ) { /* Special case to load vec3 arrays into a vec4 */
1.18 + fprintf( f, "void glsl_set_%s_%s_vec3_pointer(%s ptr, GLsizei stride){ /* attribute %s %s */ \n", program->name, var->name, getCType(var->type,var->uniform), var->type, var->name);
1.19 + fprintf( f, " glsl_set_attrib_vec3(var_%s_%s_loc,stride, ptr);\n}\n", program->name, var->name );
1.20 + }
1.21 }
1.22 }
1.23 }
.