Jump to content
  • Advertisement


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


Changing one thing on screen without re-rendering everything

This topic is 5613 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

I''m working on an RTS, and I''m trying to set it up so that when you click on a character, their stats come up in a HUD. However, I don''t know how to do this without re-rendering everything else already on screen.

Share this post

Link to post
Share on other sites
What you''re attempting to do is a very old way of doing it. 2D Games used to determine what had to be redrawn, mark a segment of the screen as dirty, and in render time, redraw that rectangle.

Nowdays, its generally better to redraw everything every frame. Amongst several reasons, its just makes things so much easier. Particularily in a complex game when most of the screen will need to be redrawn and processing power will be wasted determining what to redraw.

If you wish to try it regardless, Heres a method of the top of my head (considering I haven''t done it for years):

Have a box for the stats with certain coordinates. When the character is selected, mark the rectangle at those coordinates as ''dirty''. At render time, go through your HUD and for every ''dirty'' region, redraw that section.

This require a well-designed HUD drawing routine that organises different infomation to screen coords so that dirty regions can be bound to stats info. Try Googling for an article about this for more detail.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!