PDA

View Full Version : gluLookAt, gluPerspective and from fullscreen-to-window problems



pex22
03-31-2005, 06:32 AM
Hi.
I'm new to OpenGL and I have problems I didnt had when i tried it in GLUT (i think, but i didnt tried to back from fullscreen to window mode).
now, in my own engine, i have problems.
1) When I use gluPerspective or gluLookAt I can't see my triangle. what can cause it? the resizing function is (for gluPerspective):

void Device::resize()
{
int width=win->getWidth();
int height=win->getHeight();
if (device==LN_OPENGL)
{
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
}2) For some reason, when I back from fullscreen to window mode the window is always flashing. what can cause it? the fullscreen and window mode always worked fine (except for this problem when using opengl).

thanks,
pex.