#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);
static void Init( void )
{
+ GLuint Texture;
GLint errno;
GLuint prognum;
char buf[4096];
}
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)
--- /dev/null
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.position, {0.008}.x;
+TEX R0, R0, texture[0], 2D;
+SUB R0, R0, {0.25}.x;
+KIL R0.xyzz;
+MOV result.color, fragment.color;
+END
--- /dev/null
+!!ARBfp1.0
+TEMP R0;
+MOV R0, {0.0}.x;
+MUL R0.xy, fragment.position, {0.008}.x;
+TEX result.color, R0, texture[0], 2D;
+END