StartSpecialFX()

Syntax

StartSpecialFX()
Description
PureBasic allows you to perform real time effects like alphablending, shadow, color filter etc. These rendering effects are very CPU intensive (even if they are very optimized) and must use a special trick to be performed quickly. StartSpecialFX() creates a memory buffer to perform all the rendering and the result will be copied back to video memory when StopSpecialFX() is called. This means that hardware acceleration (i.e. graphics card chips) cannot be used during this period. All operations are performed by the main processor. This is important to understand otherwise game performance will drop a lot.

All SpecialFX operations should be grouped and rendered at one time (Shadow, translucent sprite etc). Standard sprites should be displayed after StopSpecialFX() to use the hardware acceleration, as usual. If you are using ClearScreen(), place it inside the StartSpecialFX() : ... : StopSpecialFX() block. The current display is not copied into the buffer (would be too slow), so be sure to don't call any display commands before calling StartSpecialFX() as they will be ignored.

As all the operations are done in the system memory (not on the video memory), the sprites should be loaded with the #PB_Sprite_Memory flag, to increase a lot the sprite display speed.

Commands which use the SpecialFX mode are: DisplayAlphaSprite(), DisplaySolidSprite(), DisplayShadowSprite(), DisplayRGBFilter() and DisplayTranslucentSprite()

Supported OS

Windows, Linux

<- SpriteWidth() - Sprite Index - StopSpecialFX() ->