By changing it to ulong instead of uinteger keeps it as 32 bits per pixel, i was using uinteger for long enough until someone pointed that out. Still, it's a useful way imo of creating buffers that can be manipulated fast with your own routines, making a gfx_buffer type lets you give the buffer custom properties too (I usually use 'new' instead of allocate though).
typically I start off with something like:
Code: Select all
as ulong ptr pixels 'points to bitmap in memory
as long wwidth,height 'properties of image
as ulong flags '32 bit flags which can indicate masked, blended, or other properties
'add anything else you want
as well as that, you can create that type and point it to the freebasic screenbuffer or to image buffer bitmaps and manipulate them using your custom routines with calls to the same functions/subs.
This is also pretty much the way I'm working with SDL in c++ on android and makes it pretty easy to port code between different graphics libs and between FB and C++