#include <math.h>
#include <GL/glew.h>
#include <GL/glut.h>
-#if 0
-#include "texture.h"
-#else
-#include "../util/readtex.c"
-#endif
+#include "readtex.h"
/* Some <math.h> files do not define M_PI... */
/*****************************************************************/
-void ActiveTexture(int i)
+static void
+ActiveTexture(int i)
{
glActiveTextureARB(i);
}
/* matrix = identity */
-void
+static void
matrixIdentity(GLfloat matrix[16])
{
matrix[0] = 1.0;
}
/* matrix2 = transpose(matrix1) */
-void
+static void
matrixTranspose(GLfloat matrix2[16], GLfloat matrix1[16])
{
matrix2[0] = matrix1[0];
/*****************************************************************/
/* Load the image file specified on the command line as the current texture */
-void
+static void
loadImageTextures(void)
{
GLfloat borderColor[4] =
}
/* Create a simple spotlight pattern and make it the current texture */
-void
+static void
loadSpotlightTexture(void)
{
static int texWidth = 64, texHeight = 64;
/*****************************************************************/
-void
+static void
checkErrors(void)
{
GLenum error;
}
}
-void
+static void
drawCube(void)
{
glBegin(GL_QUADS);
glEnd();
}
-void
+static void
drawDodecahedron(void)
{
#define A (0.5 * 1.61803) /* (sqrt(5) + 1) / 2 */
}
}
-void
+static void
drawSphere(void)
{
int numMajor = 24;
/*****************************************************************/
-void
+static void
initialize(void)
{
GLfloat light0Pos[4] =
}
}
-void
+static void
display(void)
{
int i;
/*****************************************************************/
/* simple trackball-like motion control */
-float lastPos[3];
-int lastTime;
+static float lastPos[3];
+static int lastTime;
-void
+static void
ptov(int x, int y, int width, int height, float v[3])
{
float d, a;
v[2] *= a;
}
-void
+static void
startMotion(int x, int y, int but, int time)
{
if (but == GLUT_LEFT_BUTTON) {
ptov(x, y, winWidth, winHeight, lastPos);
}
-void
+static void
animate(void)
{
glutPostRedisplay();
}
-void
+static void
vis(int visible)
{
if (visible == GLUT_VISIBLE) {
}
}
-void
+static void
stopMotion(int but, int time)
{
if ((but == GLUT_LEFT_BUTTON && mode == MoveView) ||
}
}
-void
+static void
trackMotion(int x, int y)
{
float curPos[3], dx, dy, dz;
/*****************************************************************/
-void
+static void
object(void)
{
static int object;
{
}
-void
+static void
texture(void)
{
static int texture = 0;
}
}
-void
+static void
help(void)
{
printf("'h' - help\n");
}
/* ARGSUSED1 */
-void
+static void
key(unsigned char key, int x, int y)
{
switch (key) {
glutPostRedisplay();
}
-void
+static void
mouse(int button, int state, int x, int y)
{
if (state == GLUT_DOWN)
glutPostRedisplay();
}
-void
+static void
reshape(int w, int h)
{
winWidth = w;
}
-void
+static void
menu(int selection)
{
if (selection == 666) {
assert(NumTextures <= MAX_TEX);
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
+ glutInitWindowSize(500,500);
(void) glutCreateWindow("projtex");
glewInit();