Faster ScrollImage

BlitzMax Forums/BlitzMax Programming/Faster ScrollImage

kochOn(Posted 2007) [#1]
Hi guys!

I want to know what is the best way (fastest) to achieve a ScrollImage Function.

Here is my code:



Hope it will exits a quickest method...


Dreamora(Posted 2007) [#2]
I see pixmap. The moment you use it you have the worst possible performance achieved, point :)

The fast way is to simply shift the UV on the quad. This will do the same but in realtime.

check the max2d dx and opengl implementations on their respective (on dx its the xyzuv array, ogl has u0 v0 u1 v1 when I remember correctly. both on the respective TImageFrame extends for OGL and DX)


kochOn(Posted 2007) [#3]
Thanks dreamora,

I know of this possibility but haven't found yet the way to access those variables.


Dreamora(Posted 2007) [#4]
You have to get the current TImageFrame from the Image (image.frames[frameNr]) and cast it to the DX or OpenGL image frame depending on if you are in OpenGL or DX


kochOn(Posted 2007) [#5]
I ve tryed this:

ifr:TImageFrame = myimage.Frames[0]
TGLImageFrame(ifr).u0 = 0.5


But still no changes. What am I doing wrong?


kochOn(Posted 2007) [#6]
Ok, it works now!

Changed:
ifr:TImageFrame = myimage.Frame(0)
TGLImageFrame(ifr).u0 = 0.5

Thanks...


tonyg(Posted 2007) [#7]
dx wrap