Author Topic: Opengl a text without BMP or vectors  (Read 5673 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Opengl a text without BMP or vectors
« on: November 15, 2020, 06:24:23 pm »
Hi
here I post a little demo to show how to make text in OpenGl mode without using a bitmap file or vectors .
I think that Opengl is a good option of Qb64 also if for now is closed in _GL sub.

Code: QB64: [Select]
  1. 'OpenGL text without mapping or font
  2.  
  3. CONST True = -1, False = 0
  4. CONST Black = _RGB32(0, 0, 0, 255), White = _RGB32(255)
  5. CONST Red = _RGB32(230, 0, 0, 255), Green = _RGB32(0, 230, 0, 255)
  6. CONST Blu = _RGB32(0, 0, 230, 255)
  7.  
  8. DIM SHARED sXp AS INTEGER, glXp AS SINGLE, sYp AS INTEGER, glYp AS SINGLE
  9. DIM SHARED glInit AS INTEGER, sRc AS INTEGER, sGc AS INTEGER, sBc AS INTEGER, sAc AS INTEGER
  10.  
  11.  
  12. T = _NEWIMAGE(600, 400, 32)
  13. S = _NEWIMAGE(600, 400, 32)
  14. _TITLE "Demo1 of Text in OpenGL"
  15.  
  16. glRun = False
  17. sBkc = White
  18. sFgc = Green
  19. PrepareTxt "Hello"
  20.  
  21. ShowSourceTxt
  22. PRINT "Now a text in OpenGL"
  23. glInit = True
  24. glRun = True
  25.     _LIMIT 10
  26.  
  27. SUB PrepareTxt (txt AS STRING)
  28.     _DEST T
  29.     CLS , Red
  30.     COLOR sFgc, sBkc
  31.     LOCATE 1, 1: PRINT txt
  32.     '    LINE (1, 1)-(40, 12), Blu, B
  33.     _DEST 0
  34.  
  35. SUB ShowSourceTxt
  36.     SCREEN T
  37.     _DELAY 3
  38.     SCREEN S
  39.  
  40.  
  41. FUNCTION Proportion (min1, max1, min2, max2, value)
  42.     'delta1: value = Delta2: x
  43.     Proportion = ((value * (max2 - min2)) / (max1 - min1)) + min2
  44.  
  45. SUB copyTxt (Xs AS INTEGER, Ys AS INTEGER, glFgc AS _UNSIGNED LONG)
  46.     DIM WidhTxt AS INTEGER, HeighTxt AS INTEGER
  47.     WidhTxt = 40
  48.     HeighTxt = 12
  49.     _SOURCE T
  50.     _DEST S
  51.  
  52.     FOR sXp = 0 TO WidhTxt STEP 1
  53.         FOR sYp = 1 TO HeighTxt STEP 1
  54.             IF POINT(sXp, sYp) = sFgc THEN
  55.                 PaintPoint Xs + sXp, Ys + sYp, glFgc
  56.             END IF
  57.         NEXT sYp
  58.     NEXT sXp
  59.  
  60.  
  61. ' OpenGl-----------------------------
  62. SUB _GL ()
  63.     IF glRun = False THEN EXIT SUB
  64.     IF glInit THEN InitGL
  65.     _glClear _GL_COLOR_BUFFER_BIT
  66.     copyTxt 1, 1, Green
  67.     copyTxt 100, 200, Red
  68.     copyTxt 200, 100, Black
  69.  
  70. SUB InitGL
  71.     glInit = False
  72.     _glClearColor 0, 0, 0.8, 1
  73.     _glFlush
  74.  
  75.  
  76. SUB PaintPoint (X AS SINGLE, Y AS SINGLE, glFgc AS _UNSIGNED LONG)
  77.     DIM gXp AS SINGLE, gYp AS SINGLE, gRc AS SINGLE, gGc AS SINGLE, gBc AS SINGLE, gAc AS SINGLE
  78.     gXp = Proportion(0, _WIDTH(T), -1, 1, X)
  79.     gYp = Proportion(0, _HEIGHT(T), 1, -1, Y)
  80.     gRc = Proportion(0, 255, 0, 1, _RED32(glFgc))
  81.     gGc = Proportion(0, 255, 0, 1, _GREEN32(glFgc))
  82.     gBc = Proportion(0, 255, 0, 1, _BLUE32(glFgc))
  83.     gAc = Proportion(0, 255, 0, 1, _ALPHA32(glFgc))
  84.     _glColor4f gRc, gGc, gBc, gAc
  85.     _glPointSize 1
  86.     _glBegin _GL_POINTS
  87.     _glVertex2f gXp, gYp
  88.     _glEnd
  89.  
  90.  

thanks to read and to try
Waiting feedbacks
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #1 on: November 15, 2020, 06:36:39 pm »
Hi
here I post the version of demo with scalable text in different dimensions
Code: QB64: [Select]
  1. 'OpenGL text without mapping or font
  2.  
  3. CONST True = -1, False = 0
  4. CONST Black = _RGB32(0, 0, 0, 255), White = _RGB32(255)
  5. CONST Red = _RGB32(230, 0, 0, 255), Green = _RGB32(0, 230, 0, 255)
  6. CONST Blu = _RGB32(0, 0, 230, 255)
  7.  
  8. DIM SHARED sXp AS INTEGER, glXp AS SINGLE, sYp AS INTEGER, glYp AS SINGLE
  9. DIM SHARED glInit AS INTEGER, sRc AS INTEGER, sGc AS INTEGER, sBc AS INTEGER, sAc AS INTEGER
  10.  
  11.  
  12. T = _NEWIMAGE(600, 400, 32)
  13. S = _NEWIMAGE(600, 400, 32)
  14. _TITLE "Demo1 of Text in OpenGL"
  15.  
  16. glRun = False
  17. sBkc = White
  18. sFgc = Green
  19. PrepareTxt "Hello"
  20.  
  21. ShowSourceTxt
  22. PRINT "Now a text in OpenGL"
  23. glInit = True
  24. glRun = True
  25.     _LIMIT 10
  26.  
  27. SUB PrepareTxt (txt AS STRING)
  28.     _DEST T
  29.     CLS , Red
  30.     COLOR sFgc, sBkc
  31.     LOCATE 1, 1: PRINT txt
  32.     '    LINE (1, 1)-(40, 12), Blu, B
  33.     _DEST 0
  34.  
  35. SUB ShowSourceTxt
  36.     SCREEN T
  37.     _DELAY 3
  38.     SCREEN S
  39.  
  40.  
  41. FUNCTION Proportion (min1, max1, min2, max2, value)
  42.     'delta1: value = Delta2: x
  43.     Proportion = ((value * (max2 - min2)) / (max1 - min1)) + min2
  44.  
  45. SUB copyTxt (Xs AS INTEGER, Ys AS INTEGER, glFgc AS _UNSIGNED LONG, Size AS INTEGER)
  46.     DIM WidhTxt AS INTEGER, HeighTxt AS INTEGER
  47.     WidhTxt = 40
  48.     HeighTxt = 12
  49.     _SOURCE T
  50.     _DEST S
  51.  
  52.     FOR sXp = 0 TO WidhTxt STEP 1
  53.         FOR sYp = 1 TO HeighTxt STEP 1
  54.             IF POINT(sXp, sYp) = sFgc THEN
  55.                 PaintPoint Xs + (sXp * Size), Ys + (sYp * Size), glFgc, Size
  56.             END IF
  57.         NEXT sYp
  58.     NEXT sXp
  59.  
  60.  
  61. ' OpenGl-----------------------------
  62. SUB _GL ()
  63.     IF glRun = False THEN EXIT SUB
  64.     IF glInit THEN InitGL
  65.     _glClear _GL_COLOR_BUFFER_BIT
  66.     copyTxt 1, 1, Green, 1
  67.     copyTxt 100, 200, Red, 2
  68.     copyTxt 200, 100, Black, 4
  69.  
  70. SUB InitGL
  71.     glInit = False
  72.     _glClearColor 0, 0, 0.8, 1
  73.     _glFlush
  74.  
  75.  
  76. SUB PaintPoint (X AS SINGLE, Y AS SINGLE, glFgc AS _UNSIGNED LONG, Sizing AS INTEGER)
  77.     DIM gXp AS SINGLE, gYp AS SINGLE, gRc AS SINGLE, gGc AS SINGLE, gBc AS SINGLE, gAc AS SINGLE
  78.     gXp = Proportion(0, _WIDTH(T), -1, 1, X)
  79.     gYp = Proportion(0, _HEIGHT(T), 1, -1, Y)
  80.     gRc = Proportion(0, 255, 0, 1, _RED32(glFgc))
  81.     gGc = Proportion(0, 255, 0, 1, _GREEN32(glFgc))
  82.     gBc = Proportion(0, 255, 0, 1, _BLUE32(glFgc))
  83.     gAc = Proportion(0, 255, 0, 1, _ALPHA32(glFgc))
  84.     _glColor4f gRc, gGc, gBc, gAc
  85.     _glPointSize Sizing
  86.     _glBegin _GL_POINTS
  87.     _glVertex2f gXp, gYp
  88.     _glEnd
  89.  
Programming isn't difficult, only it's  consuming time and coffee

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 316
  • Needle nardle noo. - Peter Sellers
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #2 on: November 15, 2020, 07:54:34 pm »
Neither of these programs will run for me.  I get a blank white screen and the message
that it's not responding.  I poked them with a sharp stick and they still did not respond.

I'm using QB64 64 bit version 1.4 on Win 10 on a Lenovo SL510.
It works better if you plug it in.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #3 on: November 15, 2020, 08:04:18 pm »
No sharp sticks needed for me:
 
hello.PNG


What's the point?

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #4 on: November 16, 2020, 08:03:31 am »
Thanks to give a look at it

@Richard Frost
I wrote it on my Asus Aspire one D257 http://www.tecnozoom.it/portatili/acer-aspire-one-d257.html
with Windows 7 starter, /Android (2.6?) 1 GB di Ram and 320 GB di HDD. Compiled with QB64 32bit version 1.4

When I have compiled it sometimes I got a stuck white windows that doesn't respond. But if I run it again I got a normal windows. So I have thought that those different performances depend from my low hardware netbook (see CPU and RAM).

I'll try it also on my Toshiba and in VMR with Ubuntu.
Programming isn't difficult, only it's  consuming time and coffee

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Opengl a text without BMP or vectors
« Reply #5 on: November 16, 2020, 09:48:51 am »
And here's a little demo of something similar, which maps text to an image, and then that image to a texture, which QB64 then uses to render however we tell it to with OpenGL...

Code: QB64: [Select]
  1. DIM SHARED AllowSubGL 'we'll set this after we finish our setup immediately below, just in case
  2. 'there is anything here (there isn't currently though) that SUB _GL will depend on
  3.  
  4. TYPE DONT_USE_GLH_Handle_TYPE
  5.     in_use AS _BYTE
  6.     handle AS LONG
  7. REDIM SHARED DONT_USE_GLH_Handle(1000) AS DONT_USE_GLH_Handle_TYPE
  8.  
  9.  
  10. SCREEN _NEWIMAGE(1024, 768, 32)
  11.  
  12.  
  13. CLS , &HFF000077
  14. LINE (200, 200)-(500, 500), _RGBA(0, 255, 255, 0), BF 'create a see-through window (press 1)
  15.  
  16. AllowSubGL = 1
  17.  
  18.     'This is our program's main loop
  19.     _LIMIT 100
  20.     LOCATE 1, 1
  21.     c = c + 1: PRINT "Mainloop has done nothing"; c; "times"
  22.     PRINT "Press 1[GL behind], 2[GL on top] or 3[GL only, good for speed] to switch rendering order."
  23.     k$ = INKEY$
  24.     IF k$ = "1" THEN _GLRENDER _BEHIND
  25.     IF k$ = "2" THEN _GLRENDER _ONTOP
  26.     IF k$ = "3" THEN _GLRENDER _ONLY
  27. LOOP UNTIL k$ = CHR$(27)
  28.  
  29. 'this specially named sub "_GL" is detected by QB64 and adds support for OpenGL commands
  30. 'it is called automatically whenever the underlying software deems an update is possible
  31. 'usually/ideally, this is in sync with your monitor's refresh rate
  32.     'STATIC was used above to make all variables in this sub maintain their values between calls to this sub
  33.  
  34.     IF AllowSubGL = 0 THEN EXIT SUB 'we aren't ready yet!
  35.  
  36.     'timing is everything, we don't know how fast the 3D renderer will call this sub to we use timers to smooth things out
  37.     T# = TIMER(0.001)
  38.     IF ETT# = 0 THEN ETT# = T#
  39.     ET# = T# - ETT#
  40.     ETT# = T#
  41.  
  42.     IF sub_gl_called = 0 THEN
  43.         sub_gl_called = 1 'we only need to perform the following code once
  44.         i = TextToImage("Hello QB64!", 16, &HFFFF0000, &H00000000, 1)
  45.         mytex = GLH_Image_to_Texture(i) 'this helper function converts the image to a texture
  46.         _FREEIMAGE i
  47.     END IF
  48.  
  49.     'These settings affect how OpenGL will render our content
  50.     '!!! THESE SETTINGS ARE TO SHOW HOW ALPHA CAN WORK, BUT IT IS 10x FASTER WHEN ALPHA OPTIONS ARE DISABLED !!!
  51.     '*** every setting must be reset because SUB _GL cannot guarantee settings have not changed since last time ***
  52.     _glMatrixMode _GL_PROJECTION 'Select The Projection Matrix
  53.     _glLoadIdentity 'Reset The Projection Matrix
  54.     _gluPerspective 45, _WIDTH(0) / _HEIGHT(0), 1, 100 'QB64 internally supports this GLU command for convenience sake, but does not support GLU
  55.     _glEnable _GL_TEXTURE_2D
  56.     _glEnable _GL_BLEND
  57.     _glBlendFunc _GL_SRC_ALPHA, _GL_ONE_MINUS_SRC_ALPHA 'how alpha values are interpretted
  58.     _glEnable _GL_DEPTH_TEST 'use the zbuffer
  59.     _glDepthMask _GL_TRUE
  60.     _glAlphaFunc _GL_GREATER, 0.5 'dont do anything if alpha isn't greater than 0.5 (or 128)
  61.     _glEnable _GL_ALPHA_TEST
  62.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MAG_FILTER, _GL_LINEAR
  63.     _glTexParameteri _GL_TEXTURE_2D, _GL_TEXTURE_MIN_FILTER, _GL_LINEAR
  64.     '**************************************************************************************************************
  65.  
  66.  
  67.     GLH_Select_Texture mytex
  68.  
  69.     _glMatrixMode _GL_MODELVIEW 'Select The Modelview Matrix
  70.     _glLoadIdentity 'Reset The Modelview Matrix
  71.     _glTranslatef 0, 0, -15 'Translate Into The Screen
  72.  
  73.     _glRotatef rotation1, 0, 1, 0 'spin, spin, spin...
  74.     _glRotatef rotation2, 1, 0, 0
  75.  
  76.     _glBegin _GL_QUADS 'we will be drawing rectangles aka. QUADs
  77.     _glTexCoord2f 0, 0: _glVertex3f 0, 0, 3 'the texture position and the position in 3D space of a vertex
  78.     _glTexCoord2f 1, 0: _glVertex3f 3, 0, 3
  79.     _glTexCoord2f 1, 1: _glVertex3f 3, -3, 3
  80.     _glTexCoord2f 0, 1: _glVertex3f 0, -3, 3
  81.     _glEnd
  82.  
  83.  
  84.     _glBegin _GL_TRIANGLES 'the png (almost) only consumes a triangular region of its rectangle
  85.  
  86.  
  87.     _glEnd
  88.  
  89.     rotation1 = rotation1 + 100 * ET# / 4
  90.     rotation2 = rotation2 + 100 * ET# / 4
  91.  
  92.  
  93.  
  94.  
  95. 'QB64 OPEN-GL HELPER MACROS (aka. GLH macros)
  96.  
  97. FUNCTION TextToImage& (text$, font&, fc&, bfc&, mode AS _BYTE)
  98.     'text$ is the text that we wish to transform into an image.
  99.     'font& is the handle of the font we want to use.
  100.     'fc& is the color of the font we want to use.
  101.     'bfc& is the background color of the font.
  102.  
  103.     'Mode 1 is print forwards
  104.     'Mode 2 is print backwards
  105.     'Mode 3 is print from top to bottom
  106.     'Mode 4 is print from bottom up
  107.     'Mode 0 got lost somewhere, but it's OK.  We check to see if our mode is < 1 or > 4 and compensate automatically if it is to make it one (default).
  108.  
  109.     IF mode < 1 OR mode > 4 THEN mode = 1
  110.     dc& = _DEFAULTCOLOR: bgc& = _BACKGROUNDCOLOR
  111.     D = _DEST
  112.     F = _FONT
  113.     IF font& <> 0 THEN _FONT font&
  114.     IF mode < 3 THEN
  115.         'print the text lengthwise
  116.         w& = _PRINTWIDTH(text$): h& = _FONTHEIGHT
  117.     ELSE
  118.         'print the text vertically
  119.         FOR i = 1 TO LEN(text$)
  120.             IF w& < _PRINTWIDTH(MID$(text$, i, 1)) THEN w& = _PRINTWIDTH(MID$(text$, i, 1))
  121.         NEXT
  122.         h& = _FONTHEIGHT * (LEN(text$))
  123.     END IF
  124.  
  125.     TextToImage& = _NEWIMAGE(w&, h&, 32)
  126.     _DEST TextToImage&
  127.     IF font& <> 0 THEN _FONT font&
  128.     COLOR fc&, bfc&
  129.  
  130.     SELECT CASE mode
  131.         CASE 1
  132.             'Print text forward
  133.             _PRINTSTRING (0, 0), text$
  134.         CASE 2
  135.             'Print text backwards
  136.             temp$ = ""
  137.             FOR i = 0 TO LEN(text$) - 1
  138.                 temp$ = temp$ + MID$(text$, LEN(text$) - i, 1)
  139.             NEXT
  140.             _PRINTSTRING (0, 0), temp$
  141.         CASE 3
  142.             'Print text upwards
  143.             'first lets reverse the text, so it's easy to place
  144.             temp$ = ""
  145.             FOR i = 0 TO LEN(text$) - 1
  146.                 temp$ = temp$ + MID$(text$, LEN(text$) - i, 1)
  147.             NEXT
  148.             'then put it where it belongs
  149.             FOR i = 1 TO LEN(text$)
  150.                 fx = (w& - _PRINTWIDTH(MID$(temp$, i, 1))) / 2 + .99 'This is to center any non-monospaced letters so they look better
  151.                 _PRINTSTRING (fx, _FONTHEIGHT * (i - 1)), MID$(temp$, i, 1)
  152.             NEXT
  153.         CASE 4
  154.             'Print text downwards
  155.             FOR i = 1 TO LEN(text$)
  156.                 fx = (w& - _PRINTWIDTH(MID$(text$, i, 1))) / 2 + .99 'This is to center any non-monospaced letters so they look better
  157.                 _PRINTSTRING (fx, _FONTHEIGHT * (i - 1)), MID$(text$, i, 1)
  158.             NEXT
  159.     END SELECT
  160.     _DEST D
  161.     COLOR dc&, bgc&
  162.     _FONT F
  163.  
  164.  
  165.  
  166.  
  167. SUB GLH_Select_Texture (texture_handle AS LONG) 'turn an image handle into a texture handle
  168.     IF texture_handle < 1 OR texture_handle > UBOUND(DONT_USE_GLH_HANDLE) THEN ERROR 258: EXIT FUNCTION
  169.     IF DONT_USE_GLH_Handle(texture_handle).in_use = 0 THEN ERROR 258: EXIT FUNCTION
  170.     _glBindTexture _GL_TEXTURE_2D, DONT_USE_GLH_Handle(texture_handle).handle
  171.  
  172. FUNCTION GLH_Image_to_Texture (image_handle AS LONG) 'turn an image handle into a texture handle
  173.     IF image_handle >= 0 THEN ERROR 258: EXIT FUNCTION 'don't allow screen pages
  174.     DIM m AS _MEM
  175.     m = _MEMIMAGE(image_handle)
  176.     DIM h AS LONG
  177.     h = DONT_USE_GLH_New_Texture_Handle
  178.     GLH_Image_to_Texture = h
  179.     _glBindTexture _GL_TEXTURE_2D, DONT_USE_GLH_Handle(h).handle
  180.     _glTexImage2D _GL_TEXTURE_2D, 0, _GL_RGBA, _WIDTH(image_handle), _HEIGHT(image_handle), 0, &H80E1&&, _GL_UNSIGNED_BYTE, m.OFFSET
  181.     _MEMFREE m
  182.  
  183. FUNCTION DONT_USE_GLH_New_Texture_Handle
  184.     handle&& = 0
  185.     _glGenTextures 1, _OFFSET(handle&&)
  186.     DONT_USE_GLH_New_Texture_Handle = handle&&
  187.     FOR h = 1 TO UBOUND(DONT_USE_GLH_Handle)
  188.         IF DONT_USE_GLH_Handle(h).in_use = 0 THEN
  189.             DONT_USE_GLH_Handle(h).in_use = 1
  190.             DONT_USE_GLH_Handle(h).handle = handle&&
  191.             DONT_USE_GLH_New_Texture_Handle = h
  192.             EXIT FUNCTION
  193.         END IF
  194.     NEXT
  195.     REDIM _PRESERVE DONT_USE_GLH_Handle(UBOUND(DONT_USE_GLH_HANDLE) * 2) AS DONT_USE_GLH_Handle_TYPE
  196.     DONT_USE_GLH_Handle(h).in_use = 1
  197.     DONT_USE_GLH_Handle(h).handle = handle&&
  198.     DONT_USE_GLH_New_Texture_Handle = h
  199.  

Notice, the majority of this is simply taken from Galleon's demo which he shared with us all many ages ago, and which can still be found in the legacy download package. 

All my modifications basically are:

I modified his example so that it turns text into an image, instead of loading an image itself to process. 
I've changed it to only work with a single texture, rather than rendering several, at various angles, at a time.
I slowed it down a bit so you can watch the rotations and altering of the text as it twists and curves across the screen.

https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #6 on: November 17, 2020, 05:03:26 am »
Hi
i'm writing from my Ubuntu 16.04 on VMW on Toshiba satellite C850L1 (windows10)
here I have installed QB64 1.2 and QB64 1.3!
Well my code works greatly and so the code posted by Steve!
here the screenshots:
my 2 demo of pixelling text
 
SimpleTxt Opengl demo.png


Steve's demo of texturing text
 
txt2img2texture demo Galleon SmcNeill.png


So it is all ok!!!
Not so quickly! Wait for my post from Windows 10.
See later.
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #7 on: November 17, 2020, 11:21:45 am »
Hi
I write from Toshiba satellite c850K1 windows 10 , Qb64 1.4
with these strange results
demo1 no text output in Opengl
demo2  the text bigger then 1 pixel point  are pixelled :-) No continuose line like in Ubuntu or in Windows 7 starter from Acer OneD257
see screenshots
 
TextOpenGl demo on 64bit .jpg


What do you think being the issue?
I want expect the same or similar behaviour in similar compatible machines, do I?
waiting feedback
Programming isn't difficult, only it's  consuming time and coffee

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #8 on: December 17, 2020, 08:12:01 am »
For me it looks like this:

 
DemoTextInOpenGL-Normal.jpg


 
DemoTextInOpenGL-GL.jpg
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #9 on: December 17, 2020, 03:47:18 pm »
Hi Kernelpanic
thanks
your result can confirm that the output is OS related. I got these same your results in Windows 10, while on the same machine in Ubuntu in WM I got the whole code working well!  It seems that QB64 translates in C++ in different way under Windows10 and under linux Ubuntu!
Programming isn't difficult, only it's  consuming time and coffee

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: Opengl a text without BMP or vectors
« Reply #10 on: December 17, 2020, 06:15:55 pm »
TempoDiBasic - Well, in Linux. I had SuSE Linux on my computer for fourteen years, from 4.3 to 11.2 - but DOS / Windows was always my main system. Linux was a hobby.
So I'm not surprised that QB64 runs differently on Linux than it does on Windows.
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“