summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-26 12:04:53 -0700
committerBrian Paul <brianp@vmware.com>2010-02-26 12:32:04 -0700
commitb056e1566268f6230c5a6f0dc06a9b4f8b22b168 (patch)
tree0c77956f2af8e2186a0f298113cc76427071c24a /progs
parentf519d3d6b649780cc557159f783c330c2a70f93b (diff)
progs/tests: add compile-time option for coloring texture corners
When debugging wrap modes it's helpful to set each corner of the texture image to a distinct color.
Diffstat (limited to 'progs')
-rw-r--r--progs/tests/texwrap.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c
index 39c55919dd..bb26635d67 100644
--- a/progs/tests/texwrap.c
+++ b/progs/tests/texwrap.c
@@ -31,6 +31,7 @@
#define BORDER_TEXTURE 1
#define NO_BORDER_TEXTURE 2
+#define COLOR_TEX_CORNERS 0
#define SIZE 8
static GLubyte BorderImage[SIZE+2][SIZE+2][4];
@@ -281,6 +282,37 @@ static void Init( void )
for (i = 0; i < SIZE; i++) {
for (j = 0; j < SIZE; j++) {
+#if COLOR_TEX_CORNERS
+ if (i == 0 && j == 0) {
+ /* lower-left texel = RED */
+ NoBorderImage[i][j][0] = 255;
+ NoBorderImage[i][j][1] = 0;
+ NoBorderImage[i][j][2] = 0;
+ NoBorderImage[i][j][3] = 255;
+ }
+ else if (i == 0 && j == SIZE-1) {
+ /* lower-right corner = GREEN */
+ NoBorderImage[i][j][0] = 0;
+ NoBorderImage[i][j][1] = 255;
+ NoBorderImage[i][j][2] = 0;
+ NoBorderImage[i][j][3] = 255;
+ }
+ else if (i == SIZE-1 && j == 0) {
+ /* upper-left corner = BLUE */
+ NoBorderImage[i][j][0] = 0;
+ NoBorderImage[i][j][1] = 0;
+ NoBorderImage[i][j][2] = 255;
+ NoBorderImage[i][j][3] = 255;
+ }
+ else if (i == SIZE-1 && j == SIZE-1) {
+ /* upper-right corner = YELLOW */
+ NoBorderImage[i][j][0] = 255;
+ NoBorderImage[i][j][1] = 255;
+ NoBorderImage[i][j][2] = 0;
+ NoBorderImage[i][j][3] = 255;
+ }
+ else
+#endif
if ((i + j) & 1) {
/* white */
NoBorderImage[i][j][0] = 255;