Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change font size / Maintain screen size.
#11
Code: (Select All)
Dim f(-1 To 0) As Long
f(-1) = _LoadFont("lucon.ttf", 32, "monospace")
f(0) = _LoadFont("lucon.ttf", 34, "monospace")

Do
    f = Not f
    _Font f(f)
    Print "Hello World, I'm looking for a memory leak!"
Loop Until _KeyHit

Simple code, and I can confirm -- it does indeed leak memory. Looks like it's something the team will have to look into. Smile
Reply
#12
Note that the following does *NOT* cause a memory leak:

Code: (Select All)
Dim f(-1 To 0) As Long
f(-1) = _LoadFont("lucon.ttf", 32, "monospace")
f(0) = _LoadFont("lucon.ttf", 34, "monospace")
Screen _NewImage(640, 480, 32)


Do
    f = Not f
    _Font f(f)
    Print "Hello World, I'm looking for a memory leak!"
Loop Until _KeyHit

This must be some glitch which occurs in SCREEN 0 from the resize routine and how font is interacting with it. In 32-bit screens, there's no leak with memory with the above code.
Reply
#13
@Pete -- That's it!  I've had it with your *voodoo snoodoo poopoo* glitches.  Watch the video below and explain to me how the heck a program can behave in such a manner!!  Pay close attention to the memory usage in task manager as the program does its thing in the background...



You've broke what little brain I had left.  What the heck type of glitch are you and SCREEN 0 pulling here?  And why can't half the other people in the world seem to duplicate the process and run into the same issue??

Code: (Select All)
Dim f(-1 To 0) As Long
f(-1) = _LoadFont("lucon.ttf", 32, "monospace")
f(0) = _LoadFont("lucon.ttf", 34, "monospace")
'Screen _NewImage(640, 480, 32)
Do
    f = Not f
    _Font f(f)
    Print "Hello World!"
    _Display
Loop Until _KeyHit


^ Code used to generate the lovely little results we see above on my laptop.  Tongue
Reply
#14
Yeah, I'm on a roll today. Found something else goofy in the IDE, too.

https://qb64phoenix.com/forum/showthread.php?tid=1109

Pete
Shoot first and shoot people who ask questions, later.
Reply
#15
(11-11-2022, 08:12 PM)MasterGy Wrote: You cannot use _printstring in hardware mode. Text output will be slow. If you include _display and use the font as a hardware image, it will be safer and much faster

I can't figure out how to quote properly, if this looks funky I apologize.

Sorry for posing this question (jeez am I Canadian? apologized twice already). 

Any way, do you have any examples of using hardware images?

I tried to do it myself and it wasn't working. I was using the wiki example I think like this:

Code: (Select All)
SCREEN _NEWIMAGE(640, 480, 32)
my_hardware_handle = _COPYIMAGE(_SCREENIMAGE, 33) 'take a screenshot and use it as our texture
_MAPTRIANGLE (0, 0)-(500, 0)-(250, 500), my_hardware_handle TO _
    (-1, 0, -1)-(1, 0, -1)-(0, 5, -10), , _SMOOTH
_DISPLAY
DO: _LIMIT 30: LOOP UNTIL INKEY$ <> "

So many questions Smile 

How does this LOOP UNTIL INKEY$ <> (a single double quote) even not register as a syntax error? But anyway, I just get a black screen on this.
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply




Users browsing this thread: 4 Guest(s)