QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Qwerkey on January 28, 2020, 09:56:55 am
-
Steve, I'm about to start a project where I will put images to the screen using _MEM processing. I'll view again your videos 1&2 to remind myself of the exact methods to change the RGB values of individual pixels. But I'm wondering when the actual screen gets updated with the new values. If I were using _HARDWARE imaging, I'd have a _DISPLAY at every processing loop to update the screen, but I assume that _DISPLAY is not required (and is inappropriate) for _MEM screen methods. Do I just set the _LIMIT value of my program to whatever is required for the correct processing rate and the screen will get updated at the computer/screen refresh rate, ie we leave the graphics setting at the default _AUTODISPLAY? - Qwerkey's dim question of the week no. 20,348!
-
Hi. You must use MEM on a software image, then convert it to hardware and then this hardware image displaying with the _DISPLAY statement. If you do not do this (with a hardware image!), The graphics card driver crashes and the program crashes.
Try it: WARNING! This program crashes your graphic driver and QB64 IDE!
_MAPTRIANGLE (0, 0)-(1024, 0)-(0, 768), himage
TO(-1, 1, -2)-(1, 1, -2)-(-1, -1, -2), 0
For runing it CORRECTLY, in loop must be _DISPLAY statement used!
-
Petr, if all else fails I will use the method as you suggest (and which I have previously done): _MEM edit a software image (same size as screen), copy to _HARDWARE, _PUTIMAGE hardware image, _DISPLAY. That should keep the processor busy!
But I thought that "Steve's" _MEM edit of the screen image directly would be more efficient, if only I knew how to do it correctly.
-
Might be best to just not use hardware acceleration in this case? The speed boost is nice but it comes at the expense of sacrificing a lot of QB64's basic graphical capabilities.