Screen Fading

BlitzPlus Forums/BlitzPlus Programming/Screen Fading

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

have you tried useing a seperate image stored in system memory as a backbuffer?



erm...

image1 = starting image you want to fade from (store in system memory as a bank or array)
image2 = ending image you want to fade to (again store as a bank or array)

virtualbuffer = createimage with the system memory flag (not stored in video memory)


you then do your fade routine on the virtualbuffer and once done.

drawimage virtualbuffer 0,0
flip

although this might seem strange it's worth a try because it can maximise your use of the system to video bandwidth

writepixelfast is slower then pokeing because the screen cords used in writepixelfast must be converted to a memory address...something already done when pokeing.

But keep in mind that when pokeing pixels or useing writepixelfast you are wasteing your system to video bandwidth potential as , simply stated, both an video memory address as well as an pixel color value are sent across to the video card with each call...not so bad when you have only a few pixels to change...

but when you are dealing with a full screen effect like this it can actualy slow things down because you are effectively sending twice the required information (a 32-bit color value + 32-bit memory address per pixel)

however useing a system image could be faster as it only needs to sent a small amount of info over to the videocard telling it where to send the image, followed by the image itself...rather then a pixel at a time, the bandwidth useage can be maximised because the card knows where to put each pixel (and how many there are) ahead of time...so the whole image can be transfered in one batch rather then each pixel individualy (and the associated memory addressing for that pixel)

at least thats the idea...try it and see if it helps.