Posted: 11th Jun 2007 23:42
1) Can the address of a bitmap be retrieved? If so, with which command?

2) Can a new backbuffer be assigned?

3) What is the purpose of Get Pixels Pointer() ?

4) Is there any way to speed 2D drawing routines to the backbuffer? Even 2D routines created with FreeBASIC are slow with DBPro.
Posted: 12th Jun 2007 5:15
Can anyone answer any of these?
Posted: 12th Jun 2007 6:02
As I understand it, :

1. Not directly, but you can use some form of copying to a known address.

2. Not unless you are able to make it the correct format, let DX9 know the format, and (I think) restart the DX9 interface.

3. I imagine to get the address of the bitmap's pixel data, which varies depending on the format.

There is a company, I think it is called Pixomatic. It is Michael Abrash; a legendary assembly language programmer. Anyway, they have a product that you might like for such things. I just can't remember the name...Granny, maybe.
Posted: 12th Jun 2007 7:17
1.

Make Memblock From File memblock_number, "your.bmp"
pBitmap = Get Memblock Ptr(memblock_number)
myData = *pBitmap // increase pBitmap with offset to value you want, it will copy a dword at a time; but this changes (sort of) if you use smaller types it is being pointed to.

tada, although I know that's not quite what you ment; it's basically the only way without dealing with Win32. Although you can get direct bytes from the file.

something like
Read Byte Position From File File_Number, Position

2. No, this can't be done in Direct3D either. You get a front and back buffer per surface. You can't transfer data (atleast not directly or quickly) between surfaces so it would be like having a seperate instance of Direct3D.

3. To draw directly to the screen as a locked operation. Basically until drawing tasks are complete it won't allow anything else pixel access; it also prevents a loop sync until complete.

4. Use the Pixel Buffer instead of the Back Buffer. You should really only use the Back Buffer if you need a post-scene effect rather than a screen effect. In both cases tbh it's much quicker using a Shader, but realistically for standard 2D ops this isn't exactly ideal.

This said I've never quite understood why the DBP BackBuffer and PixelBuffers were so damn slow compared to other languages; given it's all suppose to be running at the machine level would think it could perform such operations as quickly as Direct3D could. Aparently not though.