]> git.tdb.fi Git - libs/gl.git/commitdiff
Be more direct about getting uniform counts from the program object
authorMikko Rasa <tdb@tdb.fi>
Mon, 25 Nov 2013 15:24:18 +0000 (17:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 25 Nov 2013 15:24:18 +0000 (17:24 +0200)
source/program.cpp

index 61610493df811411cc2a82ef980633754b97f36b..8b7bc6c726f49ee1fdce4f130a9e6aaa373af25e 100644 (file)
@@ -101,10 +101,10 @@ void Program::link()
        if(!(linked = value))
                throw compile_error(get_info_log());
 
-       glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &value);
-       unsigned count = value;
+       int count;
+       glGetProgramiv(id, GL_ACTIVE_UNIFORMS, &count);
        vector<UniformInfo *> uniforms_by_index(count);
-       for(unsigned i=0; i<count; ++i)
+       for(int i=0; i<count; ++i)
        {
                char name[128];
                int len = 0;
@@ -131,9 +131,8 @@ void Program::link()
 
        if(ARB_uniform_buffer_object)
        {
-               glGetProgramiv(id, GL_ACTIVE_UNIFORM_BLOCKS, &value);
-               count = value;
-               for(unsigned i=0; i<count; ++i)
+               glGetProgramiv(id, GL_ACTIVE_UNIFORM_BLOCKS, &count);
+               for(int i=0; i<count; ++i)
                {
                        char name[128];
                        int len;