Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Opengl wglUseFontBitmaps glCallLists (https://www.delphipraxis.net/181088-opengl-wglusefontbitmaps-glcalllists.html)

luisk 14. Jul 2014 20:25

Opengl wglUseFontBitmaps glCallLists
 
Man kann ja mit wglUseFontBitmaps die Buchstaben in Listen ablegen und
dann über glCallists einen String (Text) ausgeben.

Delphi-Quellcode:
 lFont := TFont.Create; // Instanz einer Fontklasse erstellen
  try
    lFont.Name := 'arial'; // Name
    lFont.Size := 32;               // Schriftgröße
 //   lFont.Style := [fsBold];        // Styles (fsBold, fsItalic, ...)
 
 
    SelectObject(h_DC, lFont.Handle);             // Font auf einen Device Context benutzen
    wglUseFontBitmaps (h_DC, 0, 255, base); // Mit selektiertem Font Zeichen erstellen
Weiß jemand, wie hier bei glCallLists(..) der Abstand zwischen den Buchstaben des Textes eingestellt wird ?

Delphi-Quellcode:
 glPushAttrib(GL_LIST_BIT);                             // Uloží současný stav display listů
   glRasterPos3f(-2,2,-1);
   glrotatef(2.5,0,0,1);
  glListBase(base);                                      // Nastaví první display list na base
  glCallLists(length(text),GL_UNSIGNED_BYTE,Pchar(text)); // Vykreslí display listy
  glPopAttrib;

luisk 14. Jul 2014 20:42

AW: Opengl wglUseFontBitmaps glCallLists
 
ok, ich habs:
http://glasnost.itcarlow.ie/~powerk/...rays/fonts.htm
logisch:
Note that the display list for each character contains transformations to ensure that the next character's relative position is correct

Jens01 14. Jul 2014 21:00

AW: Opengl wglUseFontBitmaps glCallLists
 
Eine kleine Empfehlung : Textsuite oder hier


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:27 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz