Faster ScrollImage
BlitzMax Forums/BlitzMax Programming/Faster ScrollImage
| ||
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... |
| ||
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) |
| ||
Thanks dreamora, I know of this possibility but haven't found yet the way to access those variables. |
| ||
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 |
| ||
I ve tryed this:ifr:TImageFrame = myimage.Frames[0] TGLImageFrame(ifr).u0 = 0.5 But still no changes. What am I doing wrong? |
| ||
Ok, it works now! Changed: ifr:TImageFrame = myimage.Frame(0) TGLImageFrame(ifr).u0 = 0.5 Thanks... |
| ||
dx wrap |