OpenGLCoreTutorials icon indicating copy to clipboard operation
OpenGLCoreTutorials copied to clipboard

mtext demo: text is not drawn on Win10

Open Lulu04 opened this issue 2 years ago • 5 comments

Hi, I've tested the demos, they are great examples, thank you ! mtext demo don't work on my windows 10 machine + Lazarus 2.2.4 fpc 3.2.2: the window is filled with the blue color but no text. Any idea ?

Lulu04 avatar Sep 03 '23 08:09 Lulu04

I am traveling and do not have access to a Windows computer. I just downloaded the respository and it works fine with MacOS:

output

Does MRIcroGL show text for the colorbars on your computer? I used these small projects to build the features into MRIcroGL.

neurolabusc avatar Sep 03 '23 18:09 neurolabusc

Yes, MRIcroGL seems to work well. Nice work! Attached a screenshot. Capture

Lulu04 avatar Sep 03 '23 19:09 Lulu04

Does the font_gl.lpi project from Metal-Demos work on your computer? The idea of the Metal demos was to have projects that could compile for OpenGL (for Windows and Linux support) and Metal (for MacOS).

neurolabusc avatar Sep 04 '23 00:09 neurolabusc

Tested font_gl.lpi from Metal-Demos. I'm a bit confused about which options to keep for windows. So I've tested several combination in file glopts.inc, eliminating the RETINA define since I use Windows.

  • {$DEFINE COREGL}// {$DEFINE NEWMSDF}//{$DEFINE RETINA} generates a compile error glfont.pas(320,13) Error: identifier idents no member "SetViewport". If I comment this line the project compile and run but I can see only the fish, no text.
  • //{$DEFINE COREGL}{$DEFINE NEWMSDF}//{$DEFINE RETINA} compile but error at runtime: Unable to find Resources\fnt.json and Resources\fnt.png. After some search, these 2 files are located in the application Resources bundle directory, so I put a copy in the Resources directory -> error at runtime: msdf file is corrupted fnt.json, I can see only the fish.
  • //{$DEFINE COREGL}//{$DEFINE NEWMSDF}//{$DEFINE RETINA} compile and run but i can see only the fish.

Lulu04 avatar Sep 04 '23 08:09 Lulu04

Hello, nice work, your example helps me a lot! I got the same problem on windows 10. No text was displayed, only the blue window. In my case it was because the Metrics Json file was not read correctly due to the wrong decimal separator.

I added to the application

DefaultFormatSettings.DecimalSeparator := '.';

and now it's showing text :) Regards

404manu404 avatar Feb 01 '24 10:02 404manu404