X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=examples%2Fshared%2Flibc3%2Fsrc%2Fc3program.c;h=5e2edf41717628857f3ee6a636781004d75e6d52;hb=1b4c2367d6ee9a886949eaa64feec929cf8e387d;hp=e7c7998932b12f87bd09eca80c23c7a931cbec9d;hpb=a7b89bc57a1fd76bd25c686eeb10616831bfbcfc;p=simavr diff --git a/examples/shared/libc3/src/c3program.c b/examples/shared/libc3/src/c3program.c index e7c7998..5e2edf4 100644 --- a/examples/shared/libc3/src/c3program.c +++ b/examples/shared/libc3/src/c3program.c @@ -3,20 +3,20 @@ Copyright 2008-2012 Michel Pollet - This file is part of simavr. + This file is part of libc3. - simavr is free software: you can redistribute it and/or modify + libc3 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - simavr is distributed in the hope that it will be useful, + libc3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with simavr. If not, see . + along with libc3. If not, see . */ #include @@ -66,6 +66,17 @@ c3program_purge( c3shader_array_free(&p->shaders); } +c3program_param_p +c3program_locate_param( + c3program_p p, + const char * name ) +{ + for (int pi = 0; pi < p->params.count; pi++) + if (!strcmp(p->params.e[pi].name->str, name)) + return &p->params.e[pi]; + return NULL; +} + int c3program_load_shader( c3program_p p, @@ -138,6 +149,7 @@ c3program_load_shader( .program = p, }; c3program_param_array_add(&p->params, pa); + if (p->verbose) printf("%s %s: new parameter '%s' '%s'\n", __func__, p->name->str, unitype, uniname); } else