summaryrefslogtreecommitdiffstats
path: root/progs/fp/fp-tri.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-03-06 21:15:19 +0000
committerKeith Whitwell <[email protected]>2009-03-06 21:15:19 +0000
commit185ff38895cfc1376f21d892b122235ed0563922 (patch)
treea75ee02dc6035046540d23ec1299c391486a2453 /progs/fp/fp-tri.c
parent2dd9a0197cf3d4d8ee5808c613fab9a256b9a0e6 (diff)
fp: add some more texture, position and kill tests
Diffstat (limited to 'progs/fp/fp-tri.c')
-rw-r--r--progs/fp/fp-tri.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
index b695901bcdd..1598739c576 100644
--- a/progs/fp/fp-tri.c
+++ b/progs/fp/fp-tri.c
@@ -11,6 +11,11 @@
#include <GL/glew.h>
#include <GL/glut.h>
+#include "readtex.c"
+
+
+#define TEXTURE_FILE "../images/bw.rgb"
+
unsigned show_fps = 0;
unsigned int frame_cnt = 0;
void alarmhandler(int);
@@ -65,6 +70,7 @@ static void args(int argc, char *argv[])
static void Init( void )
{
+ GLuint Texture;
GLint errno;
GLuint prognum;
char buf[4096];
@@ -107,7 +113,19 @@ static void Init( void )
}
glEnable(GL_FRAGMENT_PROGRAM_ARB);
- glClearColor(.3, .3, .3, 0);
+
+ /* Load texture */
+ glGenTextures(1, &Texture);
+ glBindTexture(GL_TEXTURE_2D, Texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
+ printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
+ exit(1);
+ }
+
+ glClearColor(.1, .3, .5, 0);
}
static void Reshape(int width, int height)