Jump to content
  • Advertisement

Archived

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

deadlydog

Quick dumb question

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

When drawing the graphics, is it better to declare the "BeginScene()" right away in the frame loop and draw your graphics as you go; like this: // Beginning of frame loop (ran each frame) // Clear Back Buffer // Begin Scene() // Move objects // Draw objects // Check player status // Move player // Draw player // blah blah blah // End Scene() // Flip() // End of frame loop Or is it better to do the game logic first, then at the end of the frame loop have the BeginScene() and EndScene() only with drawing stuff in it, like this: // Beginning of frame loop // Move objects // Check player status // Move player // blah blah blah // Clear back buffer // Begin Scene() // Draw objects // Draw player // Draw the blah blah blah stuff // End Scene() // Flip() // End of frame loop Or does it even matter which way you do it (personal preference?). I was just wondering what the advantages of each would be and which is recommended or considered the ''standard''. I can see the first was being much easier, but less organized. Any comments? - God is my favorite fictional character

Share this post


Link to post
Share on other sites
Advertisement
theoretically, it makes no difference, as they will all end up in the same place on the screen anyway, right? Just make sure you move then draw, or else you get a false representation of what''s going on by 1 frame''s time.

I have my object move/draw each one at a time.

move
draw

move
draw

move
draw

like so. But that''s just me.

Share this post


Link to post
Share on other sites
Yep, it shouldnt matter, its just a coding style decision, so do it however it makes the most sense to you.

And on the thread title, your question isnt dumb, otherwise you wouldnt need to ask it now, would you? Try to use more meaningful titles (ie. something like ''drawing order'') rather than deriding your own questions, it can help to get a quick accurate response from someone who knows the topic.

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!