I'm following a tutorial to learn about GLUT and here's my code:
Code:
#include <GL/glut.h>
void main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
while(1) {
}
}
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}
And, it compiles fine. When I run it, I get a little thing that says 3D Tech-GLUT tutorial on the bottom panel just like its supposed to, but the window doesn't show up! Btw, I use Ubuntu Linux. What could be the problem?