Whats faster (DrawBlock/DrawBlockRect)
BlitzPlus Forums/BlitzPlus Programming/Whats faster (DrawBlock/DrawBlockRect)
| ||
Hello! If I have a Graphicsmode of 640x480 for example and a Image that is 1280x480. Is it faster to do a simple DrawBlock Command or is it faster to do a DrawBlockRect-Command and clip the image to the graphicsmode-size? |
| ||
Try it and see. A good way to time things is to use millisecs(). It helps to do [whatever] say 1000 or more times to compensate for the effect of the timing loop and the granularity of the timer. start_time#=millisecs() for f=1 to 10000 Drawblock ..... next end_time#=millisecs() actual_time_taken#=end_time-start_time time_for_one#=actual_time_taken/10000 |
| ||
I should remind you, Jochen, that an image larger than the graphics resolution is not a good idea as some old cards have problems with it, and also there are often better ways of doing such things. (eg tiles) I'd recommend you to load the image into smaller chunks, eg: img = LoadImage("image.bmp",320,240,0,8) ;Chops the image into 4x2 frames. Then when you draw the image, draw the segments you need. I don't think that this will speed up, but it should be more manageable on old systems. |