Buffering areas of a window?  
Author Message
Patrick_M





PostPosted: Game Technologies: DirectX 101, Buffering areas of a window? Top

I have a Managed DirectX program that makes use of what you might call "virtual" windows inside a main windows form. Each one of these virtual windows can contain a lot of lines and polygons that don't always need to be updated, but are subsequently re-rendered everytime I update the windows form. Right now I'm trying to figure out the best way to "buffer" these windows so that I can just redraw them as a sprite instead of actually re-rendering all the objects every time. The only way I can think of to do this right now is by use of the RenderToSurface class. Is this the only way to do this, or is there a simpler way to buffer a section of the window

Thanks so much for any help!

Pat



Game Technologies: DirectX, XNA, XACT, etc.11  
 
 
Neil Beresford





PostPosted: Game Technologies: DirectX 101, Buffering areas of a window? Top

Hi Pat,

just off the top of my head, I'm assuming you have references to all the windows etc.. maybe creating a dirty rectange system for updating, and only force an update when needed via this system. It's a nice way of controlling your redraws, in a gui sort of fashion!

With regards your cheap fix - drawing to an surface and then showing that, well it worked for me ...

I created an GraphicsStream and got the backbuffer then saved this to the stream. For reference to this stream, I then used the TectureLoader class to create an texture for me to display, instead of complete redraws. I would be more then happy to forward this code to you as an example,

many thanks - Neil


 
 
Patrick_M





PostPosted: Game Technologies: DirectX 101, Buffering areas of a window? Top



Pat