Add a flag to CreateImage that stops the image buffer from being cleared

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Axeman
User
User
Posts: 89
Joined: Mon Nov 03, 2003 5:34 am

Add a flag to CreateImage that stops the image buffer from being cleared

Post by Axeman »

By default, CreateImage fills the newly created image buffer with a background color. A lot of the time when you use CreateImage to create an image buffer, you immediately overwrite any data in it with new data by drawing to it. This makes the initial fill operation pointless and adds an unnecessary time overhead to your program.

It would be great if there was a flag for CreateImage that worked in a similar fashion to the #PB_Memory_NoClear flag for AllocateMemory to stop the image buffer from being cleared unnecessarily.