So, I was reading http://ogldev.atspace.co.uk/www/tutorial02/tutorial02.html and it said I needed math_3d.h for Vector3f.
I tried to include it:
#include <stdio.h>
#include "GL/glew.h"
#include "GL/gl.h"
#include "GL/freeglut.h"
#include "math_3d.h"
void render() {
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
glFlush();
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(800, 600);
glutInitWindowPosition(100, 100);
glutCreateWindow("OpenGL - First window demo");
/* Set */
GLenum res = glewInit();
if (res != GLEW_OK) {
fprintf(stderr, "Error: '%s'\n", glewGetErrorString(res));
return 1;
}
Vector3f vertices[1];
glutDisplayFunc(render);
glutMainLoop();
return 0;
}
G++ said “main.cpp:7:21: fatal error: math_3d.h: No such file or directory”. I looked for an Arch Linux package for it, but I found nothing.
I found the file here:
http://ogldev.googlecode.com/svn-history/r75/trunk/tutorial36/math_3d.h
Am I supposed to download that file and place it my project directory, or is there a cleaner way of doing it?
Also, if I do include it in my directory, how can I add it to the g++ line?
gcc main.cpp -o main -lGLEW -lglut -lGL
Yes