diff options
author | Brian Paul <brianp@vmware.com> | 2010-12-13 18:03:55 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-12-13 18:04:02 -0700 |
commit | efcecb2465183d34924fb4539f2fa17c5cb7eb7a (patch) | |
tree | 5776f8a597a795f97a16dcef5d59586b4781256d /src/glsl | |
parent | 4a735eb46895e1d8ea56cd51e647f1fc02bafb25 (diff) |
shadow_sampler: probe/print pixel value, fix GL version check
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/shadow_sampler.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/glsl/shadow_sampler.c b/src/glsl/shadow_sampler.c index 0adc9d88..f759c06b 100644 --- a/src/glsl/shadow_sampler.c +++ b/src/glsl/shadow_sampler.c @@ -88,6 +88,18 @@ Redisplay(void) glWindowPos2iARB(80, 20); PrintString("white black white black"); + { + GLfloat pix[4]; + glReadPixels(120, 150, 1, 1, GL_RGBA, GL_FLOAT, pix); + printf("Pixel(120, 150): %f %f %f %f\n", pix[0], pix[1], pix[2], pix[3]); + glReadPixels(180, 150, 1, 1, GL_RGBA, GL_FLOAT, pix); + printf("Pixel(180, 150): %f %f %f %f\n", pix[0], pix[1], pix[2], pix[3]); + glReadPixels(220, 150, 1, 1, GL_RGBA, GL_FLOAT, pix); + printf("Pixel(220, 150): %f %f %f %f\n", pix[0], pix[1], pix[2], pix[3]); + glReadPixels(280, 150, 1, 1, GL_RGBA, GL_FLOAT, pix); + printf("Pixel(280, 150): %f %f %f %f\n", pix[0], pix[1], pix[2], pix[3]); + } + glutSwapBuffers(); } @@ -258,7 +270,7 @@ Init(void) #endif version = (const char *) glGetString(GL_VERSION); - if (version[0] != '2' || version[1] != '.') { + if (version[0] * 10 + version[2] <= 20) { printf("This program requires OpenGL 2.x, found %s\n", version); exit(1); } |