Реферат: Отчет по OpenGL
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
gluPerspective(30.0, Width/Height, 1.0, 10.0);
glViewport(0, 0, Width, Height);
glMatrixMode(GL_MODELVIEW);
InvalidateRect(Handle, nil, False);
end;
// Обработка сообщения WM_PAINT, рисование окна
procedure TForm1.WMPaint(var Msg: TWMPaint);
var
ps: TPaintStruct;
begin
BeginPaint(Handle, ps);
DrawScene;
EndPaint(Handle, ps);
end;
// Конец работы программы
procedure TForm1.FormDestroy(Sender: TObject);
begin
wglMakeCurrent(0, 0);
wglDeleteContext(hrc);
ReleaseDC(Handle, DC);
end;
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=27 then Application.Terminate; // Esc
FormResize(nil);
end;
end.
Рисунок «Куб»