09-17-2023, 02:56 AM
This question pertains to my work on the hardware acceleration lesson in the tutorial.
According to the Wiki _PUTIMAGE should be allowed to use hardware images as either the source or destination. However this is not working for me. Please take a look at the sample code I included below. Am I missing something obvious or does the Wiki need updating?
According to the Wiki _PUTIMAGE should be allowed to use hardware images as either the source or destination. However this is not working for me. Please take a look at the sample code I included below. Am I missing something obvious or does the Wiki need updating?
Code: (Select All)
OPTION _EXPLICIT ' declare those variables son!
DIM SWimage AS LONG ' software image
DIM HWimage AS LONG ' hardware image
SCREEN _NEWIMAGE(640, 480, 32) ' create a software surface
SWimage = _NEWIMAGE(100, 100, 32) ' create a software image
_DEST SWimage ' draw on the software image
CIRCLE (49, 49), 49 ' create a full size circle on the software image
HWimage = _COPYIMAGE(SWimage, 33) ' create a hardware version of the software image
CLS ' clear the software image
CIRCLE (49, 49), 24 ' create a half size circle on the software image
_DEST 0 ' return to the software surface
_PUTIMAGE (0, 0), SWimage ' place the software image onto the software surface
'+------------------------------------------------------------------------------------------------------------------+
'| According to the Wiki _PUTIMAGE should be allowed to use hardware images, however it's not working. |
'| |
'| "Hardware images (created using mode 33 via _LOADIMAGE or _COPYIMAGE) can be used as the source or destination." |
'| |
'| The quote above was taken directly from the Wiki. |
'+------------------------------------------------------------------------------------------------------------------+
'_PUTIMAGE (0, 0), HWimage, SWimage ' nope, invalid handle <<--- neither one of these work?
'_PUTIMAGE (0, 0), SWimage, HWimage ' nope, invalid handle <<---
DO
_LIMIT 15 ' slow down hoss
_PUTIMAGE (0, 0), HWimage ' draw the hardware image over the software image
_DISPLAY ' update the surfaces
LOOP UNTIL _KEYDOWN(27) ' leave when ESC pressed
_FREEIMAGE SWimage
_FREEIMAGE HWimage