summaryrefslogtreecommitdiffstats
path: root/progs/demos
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-03-22 13:32:35 +0000
committerKeith Whitwell <[email protected]>2005-03-22 13:32:35 +0000
commit46d50d9e8ed5b060ef1591bf4b172de6d692cc9d (patch)
tree23f6a9f81b20eeae150e1a1cedb9f89ca48f95c7 /progs/demos
parentde4fe1e3c5ce64b309884fd1c82b6cc9e6a4aedc (diff)
Add more formats to test.
Diffstat (limited to 'progs/demos')
-rw-r--r--progs/demos/texdown.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/progs/demos/texdown.c b/progs/demos/texdown.c
index 9f4f5086917..79525a0395e 100644
--- a/progs/demos/texdown.c
+++ b/progs/demos/texdown.c
@@ -47,7 +47,6 @@ static GLdouble DownloadRate = 0.0; /* texels/sec */
static GLuint Mode = 0;
-#define NUM_FORMATS 4
struct FormatRec {
GLenum Format;
GLenum Type;
@@ -56,15 +55,20 @@ struct FormatRec {
};
-static const struct FormatRec FormatTable[NUM_FORMATS] = {
+static const struct FormatRec FormatTable[] = {
/* Format Type IntFormat TexelSize */
+ { GL_BGRA, GL_UNSIGNED_BYTE, GL_RGBA, 4 },
{ GL_RGB, GL_UNSIGNED_BYTE, GL_RGB, 3 },
{ GL_RGBA, GL_UNSIGNED_BYTE, GL_RGBA, 4 },
{ GL_RGBA, GL_UNSIGNED_BYTE, GL_RGB, 4 },
{ GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB, 2 },
+ { GL_LUMINANCE, GL_UNSIGNED_BYTE, GL_LUMINANCE, 1 },
+ { GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_LUMINANCE_ALPHA, 2 },
+ { GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA, 1 },
};
static GLint Format;
+#define NUM_FORMATS (sizeof(FormatTable)/sizeof(FormatTable[0]))
static int
BytesPerTexel(GLint format)
@@ -81,6 +85,14 @@ FormatStr(GLenum format)
return "GL_RGB";
case GL_RGBA:
return "GL_RGBA";
+ case GL_BGRA:
+ return "GL_BGRA";
+ case GL_LUMINANCE:
+ return "GL_LUMINANCE";
+ case GL_LUMINANCE_ALPHA:
+ return "GL_LUMINANCE_ALPHA";
+ case GL_ALPHA:
+ return "GL_ALPHA";
default:
return "";
}
@@ -314,6 +326,11 @@ Key(unsigned char key, int x, int y)
Format = (Format + 1) % NUM_FORMATS;
Mode = 0;
break;
+ case 'F':
+ /* change format */
+ Format = (Format - 1) % NUM_FORMATS;
+ Mode = 0;
+ break;
case 'p':
/* toggle border */
ScaleAndBias = !ScaleAndBias;