include $(TOP)/configs/current
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
SOURCES = \
tri-tex.c \
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
+
+#ifndef WIN32
#include <unistd.h>
#include <signal.h>
+#endif
+
+#include <GL/glew.h>
+#include <GL/glut.h>
unsigned show_fps = 0;
unsigned int frame_cnt = 0;
static void usage(char *name)
{
fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
+#ifndef WIN32
fprintf(stderr, "\n" );
fprintf(stderr, "options:\n");
fprintf(stderr, " -fps show frames per second\n");
+#endif
}
+#ifndef WIN32
void alarmhandler (int sig)
{
if (sig == SIGALRM) {
signal(SIGALRM, alarmhandler);
alarm(5);
}
+#endif
static void args(int argc, char *argv[])
{
glEnd();
glFlush();
-
if (show_fps) {
++frame_cnt;
glutPostRedisplay();
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
args(argc, argv);
glutCreateWindow(filename);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
Init();
+#ifndef WIN32
if (show_fps) {
signal(SIGALRM, alarmhandler);
alarm(5);
}
+#endif
glutMainLoop();
return 0;
}