Locking the Backbuffer , HOW ?
Hi ppl !
The topic says it all :
How can I lock the Backbuffer of a Direct3D8
application and write to it ?
I need it for a RTS, drawing the selecting box ...
I''ve tried it, but I didn''t succeed :-(
Thx4help !
call:
IDirect3DDevice8::GetBackBuffer
then:
IDirect3DSurface8::LockRect
You get a pointer back along with some info about the width of the buffer etc.
But why not just use DrawPrimitive with D3DPT_LINESTRIP to make your box, its probably much faster.
IDirect3DDevice8::GetBackBuffer
then:
IDirect3DSurface8::LockRect
You get a pointer back along with some info about the width of the buffer etc.
But why not just use DrawPrimitive with D3DPT_LINESTRIP to make your box, its probably much faster.
You might even get away with drawing 2 trianlges with a transparent texture on them that look like a box. That depends on whether you are using 2d or 3d. If you are using 2d you might end up in a bit of trouble with the z-buffer.
quote:Original post by Anonymous Poster
But why not just use DrawPrimitive with D3DPT_LINESTRIP to make your box, its probably much faster.
Good idea, thx 4 help :-)
Hi !
Back to the problem of locking :
Drawing with LineStrips works fine, BUT :
There will be several players : Blue, Red, Green....
How can you lock a LPDIRECT3DTEXTURE8 and change
values there ?
I did not succeed again, though I tried hard :-(
Thx 4 help again !
Hi !
Back to the problem of locking :
Drawing with LineStrips works fine, BUT :
There will be several players : Blue, Red, Green....
How can you lock a LPDIRECT3DTEXTURE8 and change
values there ?
I did not succeed again, though I tried hard :-(
Thx 4 help again !
Again, I bet you can get the effect you''re looking for without locking the texture. Perhaps something along the lines different blending modes. Or... if there are only a couple different colors, it might be much faster to author a couple different textures rather than changing them at runtime.
quote:Original post by CrazedGenius
Again, I bet you can get the effect you''re looking for without locking the texture. Perhaps something along the lines different blending modes. Or... if there are only a couple different colors, it might be much faster to author a couple different textures rather than changing them at runtime.
Well, I would change them when I start the prog, NOT at runtime.
Take a look @Red Alert : There are green , red... Tanks.
I can''t imagine they''ve got 100 copys for every color ???
Blending does not work, already tested ;-)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement