PDA

View Full Version : Noob has problem



Kremsn
06-15-2009, 09:24 AM
Hi,

can someone tell me whats wrong with this exampleprogram? does not compile with dev c++ 4.992. Shows just a simple line




#include <GL/glut.h>
#include <windows.h>
#include <stdlib.h>

void init(void){

glClearColor(1.0, 1.0, 1.0, 0.0);

glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0, 200.0, 0.0, 150.0);
}
void display(void){

glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0, 0.0, 0.0);
glBegin(GL_LINES);
glVertex2i(180, 15);
glVertex2i(10, 145);
glEnd();
glFlush();
}

int main(int argc, char** argv)
{
glutInit(&amp;argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPostition(50, 100);
glutInitWindowSize(400, 300);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

dletozeun
06-15-2009, 10:10 AM
Show compiler output.

Makinis
06-15-2009, 11:32 AM
#include <GL/glut.h>
#include <windows.h>
#include <stdlib.h>


Instead:


#include <windows.h>
#include <stdlib.h>
#include <GL/glut.h>



glutInitWindowPostition(50, 100);


I'm not going to tell what is wrong with this ;p

Kremsn
06-15-2009, 12:05 PM
O dear, i must be blind

Makinis
06-16-2009, 02:49 AM
That's what I thought ;)