0

I have been working on a graphics project in C using Codeblocks and Glut lib. Everything was going well and then tried it in Visual Studio Express 2013 RC. In VSE my graphics are no longer centered in the window. Look to be shifted about 2% to the left and top. I have defined everything I can think of

glutInitWindowSize(1000, 500);
glutInitWindowPosition(100, 100); // Set the position of the window

Reshape function looks like this

glViewport(0, 0, (GLsizei)width, (GLsizei)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(-1.0, 1.0, -1.0, 1.0);   // multiply by new coordinates.
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

initialization is this:

glMatrixMode(GL_PROJECTION);            // Select the matrix to change,
glLoadIdentity();                       // clear it,
gluOrtho2D(-1.0, 1.0, -1.0, 1.0);   // multiply by new coordinates.
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glLineWidth(1.0);
glClearColor(1.0, 1.0, 1.0, 0.0);
4

0 回答 0