Статья: OpenGL и Delphi на практике
begin
H:=Handle;
DC:=GetDC(H);
SetDCPixelFormat(DC);
RC:=wglCreateContext(DC);
wglMakeCurrent(DC,RC);
glClearColor(0.6,0.6,0.6,1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
glFrustum(-1,1,-1,1,2,20);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glTranslatef(0.0,-1.0,-6.0);
BeginPaint;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
wglMakeCurrent(0,0);
wglDeleteContext(RC);
ReleaseDC(H,DC);
DeleteDC(DC);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
glRotatef(4.0,0.0,1.0,0.0);
SwapBuffers(DC);
InvalidateRect(H,nil,False);
end;
procedure DrawElement(a,b,r0,r1:Single);