Direct memory access to Buffers in C++

Archives Forums/Blitz3D SDK Programming/Direct memory access to Buffers in C++

Andreas(Posted 2008) [#1]
Hello,

I noticed that the int value given back by bbFrontBuffer() is a memory address pointing to a struct. This struct contains values like the width, height and depth of the buffer. The size of the struct is nearly 10k.

In BlitzPlus there were functions such as LockedFormat, LockedPitch and LockedPixels. Through these functions it was possible to directly access the memory of the graphics canvas of the buffer.

My question is: is it possible to "rebuild" these functions by addressing an offset of the buffer? So that I can directly paint on the buffer instead of using WritePixel / WritePixelFast which seems to be a bottleneck in my project.

The offsets that I need to access the required values of the struct would be quite helpful.

Andreas


Kale Kold(Posted 2008) [#2]
yes it would be nice to read this structure. Especially for the width and height of any given buffer.

I would also like to know what fields are in this structure and also if this can be read from the other buffer commands.


Andreas(Posted 2008) [#3]
Another question is whether textures, images, frontbuffers, backbuffers etc. are (or can be) stored in system memory instead of graphics memory so that they can be manually manipulated?