Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Headhunter

Locking the Backbuffer , HOW ?

This topic is 6039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 !

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 :-)

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;-)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!