PS.: Malice, you're suggesting to create a bmap_zbuffer, but isn't bitmap creation slow? I also don't have a clue how render targets work. Used them a lot of years ago, and I have no memory of that process.
Truely I'm just throwing out ideas. But If I understand render z buffer is a direct d3d surface with pointer to the d3d object.
As for using this kind of idea, txesmi did a lot of working it out in a thread in this very topic a week or so ago. So striping the code he posted to what you need 'could' be half your work.
LINK HERE As to speed or if anything I say will work, I'm just spite-firing idea's. I have no clue. I'll try to do some testing, however I'll likely fail as I'm miles behind you in understanding all this.
Mal
EDIT- This didn't crash, however examining the d3d9.h and looking to transfer this
http://gamedev.stackexchange.com/questio...without-using-d Makes my mind explode... I want to help but I am way over my head here. I have no idea what is happening at GetDC() and it might melt your pc. This stuff is to high level for me to just trail and error throw. Sorry
Mal
#include <acknex.h>
#include <d3d9.h>
void main()
{
.............................
BMAP *bmpMap = bmap_createblack(1920,1200,32);
BMAP *bmpScreen = bmap_createblack ( screen_size.x, screen_size.y, 24 );
bmap_zbuffer(bmap_createblack(2048,2048,32));
while(1)
{
bmap_rendertarget(bmpMap,0,0);
GetDC(render_zbuffer);
bmap_rendertarget(NULL,0,0);
wait(1);
}
}