BASIC

Author Topic: FASTMEM2SPRITE  (Read 92 times)

Offline Qedo

  • Mr. Polyvector
  • ***
  • Posts: 132
  • UNUS SED LEO
    • View Profile
FASTMEM2SPRITE
« on: 2017-Nov-11 »
For my application I found a certain slowness with MEM2SPRITE so I searched in the GLBASIC forum for a solution to this problem without finding anything.
So I wrote FASTMEM2SPRITE using the OpenGL routines. The result it is very fast and in some conditions, in high sprite resolution, even a 6X ratio on my computer. In Android, the increase is even slightly higher. The syntax is the same, obviously by adding FAST to the command. The only difference is that to draw the sprite because of the different coordinates of the OpenGL screen (bottom / left) you have to use the ZOOMSPRITE nsprite, 0,0, 1, -1 (vertical mirror).
Tried on Win and Android.
If you have better solution then you will be happy to receive your jobs.
Use it freely and let me know.
Ciao

Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 159
    • View Profile
    • my personal website
Re: FASTMEM2SPRITE
« Reply #1 on: 2017-Nov-13 »
Very nice indeed, short and clean. Currently I don't have any use for it but with this speed can be surely used for some in-game effects.
Another good thing is that you can get CreateScreen out of function and this will speed it two times - that's good for effects on already created sprites/textures.
Check my source code editor for GLBasic - link