PDA

View Full Version : Also.... one more!



05-08-2001, 06:45 AM
Hey, forgot something! i need to set a perspective mode... this is my current code:

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{

// TODO: Place code here.
//glutInit(argcbogo, argvbogo);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(200, 200);
glutCreateWindow("Actual window");

init();
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMainLoop();

return 0;
}

its a win32 app (not console). Help?

Boresight
05-08-2001, 09:47 AM
the reshape function?

You must set reshape funtion with glutReshapeFunc.

void reshape(int w, int h) {
}
...
glutReshapeFunc(reshape);
...

In reshape you set initial visualization parameters.

glViewport();
glFrustum(); // for perspective mode
... etc.

[This message has been edited by Boresight (edited 05-08-2001).]

Warrior
05-08-2001, 10:29 AM
you cant use win32 and glut at the same time.
get rid of all your win32 code. glut handles the window for you.

05-09-2001, 12:08 AM
Ok guys, thanx i will try.