Deplhi môže pracovať s 3D grafikou aj s pomocou OpenGL.

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, OpenGL;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
 
var
  Form1: TForm1;
  rc : HGLRC;
 
implementation
 
{$R *.DFM}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  glClear(GL_COLOR_BUFFER_BIT);
  glPushMatrix();
  glBegin(GL_POLYGON);
 
  {Kreslenie trojuholniku}
    glColor3f(1.0,0.0,0.0);
    glVertex3f(-0.5,0.0,0.0);
    glColor3f(0.0,1.0,0.0);
    glVertex3f(0.5,0.0,0.0);
    glColor3f(0.0,0.0,1.0);
    glVertex3f(0.0,0.75,0.0);
    glVertex3f(-0.5,0.0,0.0);
 
  glEnd();
  glFlush();
end;
 
procedure TForm1.FormCreate(Sender: TObject);
var
  dc : HDC;
  pf : integer;
  pfd : TPIXELFORMATDESCRIPTOR;
begin
  {OpenGL inicializacia}
  dc := GetDC(Handle);
 
  {PixelFormat nastavenie}
  pfd.nSize := sizeof(pfd);
  pfd.nVersion := 1;
  pfd.dwFlags := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or 0;
  pfd.iPixelType := PFD_TYPE_RGBA;
  pfd.cColorBits := 32;
 
  pf := ChoosePixelFormat(dc, @pfd);
  SetPixelFormat(dc, pf, @pfd);
 
  rc := wglCreateContext(dc);
  wglMakeCurrent(dc, rc);
 
end;
 
procedure TForm1.FormDestroy(Sender: TObject);
begin
  wglMakeCurrent(0, 0);
  wglDeleteContext(rc);
end;
 
end.