OpenGL


1. Windows - 4


GLvoid ReSizeGLScene(GLsizei Width, GLsizei Height)

{

if (Height==0)// ,

Height=1;


glViewport(0, 0, Width, Height);

//


glMatrixMode(GL_PROJECTION);//

glLoadIdentity();//


gluPerspective(45.0f,(GLfloat)Width/(GLfloat)Height,0.1f,100.0f);

//

glMatrixMode(GL_MODELVIEW);//

}

. , , . , . OpenGL, OpenGL, glLoadIdentity(). OpenGL, . , , , .

GLvoid DrawGLScene(GLvoid)

{

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

//

glLoadIdentity();

//

}

. Windows, , , , .

: hWnd . message , . wParam lParam , , .

LRESULT CALLBACK WndProc(HWNDhWnd,

UINTmessage,

WPARAMwParam,