diff options
author | Brian Paul <[email protected]> | 2009-02-09 09:22:22 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-02-09 09:22:22 -0700 |
commit | e97681c7f551a2a2a6bd5eff0f4192a870c816c0 (patch) | |
tree | dff2bf0e6d22efb92af131f64be0621ed316977c /progs/demos/fslight.c | |
parent | 1a46c8a062aea59de5cf55881104489db5d609e5 (diff) | |
parent | b907d4cd8fafe719b4f87d877562829548937485 (diff) |
mesa: merge gallium-0.2 into gallium-master-merge
Merge commit 'origin/gallium-0.2' into gallium-master-merge
Conflicts:
Makefile
docs/relnotes-7.4.html
docs/relnotes.html
src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/main/imports.c
src/mesa/main/mtypes.h
src/mesa/main/texcompress.c
src/mesa/main/texenvprogram.c
src/mesa/main/version.h
src/mesa/vbo/vbo_exec_api.c
src/mesa/vbo/vbo_save_draw.c
Diffstat (limited to 'progs/demos/fslight.c')
-rw-r--r-- | progs/demos/fslight.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index e6d83bf8fb3..e79b5cc1970 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -225,33 +225,6 @@ static void TestFunctions(void) { printf("Error 0x%x at line %d\n", glGetError(), __LINE__); - { - GLfloat pos[3]; - printf("Error 0x%x at line %d\n", glGetError(), __LINE__); - printf("Light pos %g %g %g\n", pos[0], pos[1], pos[2]); - } - - - { - GLfloat m[16], result[16]; - GLint mPos; - int i; - - for (i = 0; i < 16; i++) - m[i] = (float) i; - - mPos = glGetUniformLocation_func(program, "m"); - printf("Error 0x%x at line %d\n", glGetError(), __LINE__); - glUniformMatrix4fv_func(mPos, 1, GL_FALSE, m); - printf("Error 0x%x at line %d\n", glGetError(), __LINE__); - - glGetUniformfv_func(program, mPos, result); - printf("Error 0x%x at line %d\n", glGetError(), __LINE__); - - for (i = 0; i < 16; i++) { - printf("%8g %8g\n", m[i], result[i]); - } - } assert(glIsProgram_func(program)); assert(glIsShader_func(fragShader)); @@ -280,6 +253,22 @@ TestFunctions(void) glGetProgramInfoLog_func(program, 1000, &len, log); printf("Program Info Log: %s\n", log); } + + /* active uniforms */ + { + GLint n, max, i; + glGetProgramiv_func(program, GL_ACTIVE_UNIFORMS, &n); + glGetProgramiv_func(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max); + printf("Num uniforms: %d Max name length: %d\n", n, max); + for (i = 0; i < n; i++) { + GLint size, len; + GLenum type; + char name[100]; + glGetActiveUniform_func(program, i, 100, &len, &size, &type, name); + printf(" %d: %s nameLen=%d size=%d type=0x%x\n", + i, name, len, size, type); + } + } } @@ -512,7 +501,9 @@ Init(void) glUniform4fv_func(uDiffuse, 1, diffuse); glUniform4fv_func(uSpecular, 1, specular); /* assert(glGetError() == 0);*/ +#if TEXTURE glUniform1i_func(uTexture, 2); /* use texture unit 2 */ +#endif /*assert(glGetError() == 0);*/ if (CoordAttrib) { |