[Solved] How can I show text with OpenGL? lazarus / 70-OpenGL ---------------------------------------------------------------------- loaded · 2018-03-02 13:57 Hi All, The methods I tried; The method here is rather slow and simple -https://www.entwickler-ecke.de/topic_2D+Text+in+OpenGL_39104,0.html The method here is nice but slow -https://stackoverflow.com/questions/17733965/strange-behaviour-in- opengl Are there alternative methods for displaying text with Opengl? Thank you for helping. ---------------------------------------------------------------------- marcov · 2018-03-02 14:30 Search for "signed distance" (fonts) on this forum: http://forum.lazarus- ide.org/index.php/topic,30556.msg194484.html#msg194484 and http://forum.lazarus- ide.org/index.php/topic,37470.msg255979.html#msg255979 ---------------------------------------------------------------------- loaded · 2018-03-03 04:29 Hi Marcov I downloaded the samples and started working on the subject right now. Also, thank you very much for your precious reply. ---------------------------------------------------------------------- comingnine · 2018-03-03 08:03 IIRC, TextSuite could be used together with OpenGL to draw text. ---------------------------------------------------------------------- loaded · 2018-03-03 08:35 comingnine, thank you for your answer. What is IIRC? Could you show me an example of the subject? ---------------------------------------------------------------------- comingnine · 2018-03-03 10:26 The source & sample can be found here http://www.dev- center.de/projects/textsuite PS: There seems to be an updated version https://git.bergmann89.de/opengl/TextSuite ---------------------------------------------------------------------- howardpc · 2018-03-03 10:33 Quote from: loaded on March 03, 2018, 09:35:10 amWhat is IIRC? "If I remember correctly" ---------------------------------------------------------------------- wp · 2018-03-03 10:47 Quote from: comingnine on March 03, 2018, 11:26:34 amThe source & sample can be found here http://www.dev-center.de/projects/textsuite PS: There seems to be an updated version https://git.bergmann89.de/opengl/TextSuite I don't like libraries which introduce an unneeded dependence on other libraries, here: bitSpaceOpenGL. Isn't the built-in OpenGL support enough? Why does everybody have to reinvent the wheel? In TAChart's TADrawerOpenGL there is text support for OpenGL using FreeType (based on units which comes with FPC and Lazarus). It is not directly usable, but could easily be copied and pasted into a separate standalone unit; the basic work is done by the TGLFreeTypeHelper class. [EDIT] For the current trunk version of lazarus, I extracted the OpenGL text support into a separate unit, TAOpenGL. But not: text rendering is only supported as 2D texture ---------------------------------------------------------------------- marcov · 2018-03-03 13:03 Quote from: loaded on March 02, 2018, 02:57:03 pmThe method here is rather slow and simple -https://www.entwickler-ecke.de/topic_2D+Text+in+OpenGL_39104,0.html I currently still use this (wglusefontbitmap + callists) for small text because it is the fastest. It is not portable though, but for me that is not (yet) really a problem.  Fast as in time spend in opengl overall per frame, so that is drawing and  preparation. The preparation with the array of vertices for signed distance fonts is quite slow, and for me that happens every frame. I only work on opengl from time to time though, but some improvements have been made since the last upload of that code. Note that if you somewhat can understand German like me, there is also https://delphigl.com/forum/index.php though, while it is not as active anymore as it used to be, I did get some nice answers there. ---------------------------------------------------------------------- ChrisR · 2018-03-03 14:25 I think multi-channel signed distance fonts are the best solution. You can see my Lazarus solution here (Project 5):   https://github.com/neurolabusc/OpenGLCoreTutorials This approach uses minimal dependencies, is scalable, can be rotated, and is very fast. ---------------------------------------------------------------------- loaded · 2018-03-04 06:00 ChrisR and marcov and wp and howardpc and comingnine Thank you all individually thank you. comingnine, Quote from: comingnine on March 03, 2018, 11:26:34 amThe source & sample can be found here http://www.dev-center.de/projects/textsuite PS: There seems to be an updated version https://git.bergmann89.de/opengl/TextSuite TextSuite has seen my work. The text has to be rotated, I think I should solve it with math functions.Respects