Jump to content
  • Advertisement
Sign in to follow this  
user88

how to know if the BeginScene method is called before

This topic is 3410 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 all. I use Managed DirecX, but i will very grateful if give me suggestion in not MDX. How i can recognize if BeginScene method is called before. Has Device type some property whitch can indicate this??

Share this post


Link to post
Share on other sites
Advertisement
Kind of depends how you want to use this. If you just want to see if you should be calling BeginScene or not and call it anyway if you are already iside a Begin/End scene it will return the value D3DERR_INVALIDCALL.

If you just want to see if you are ok to render or something and don't want to risk actually calling BeginScene to check then you are out of luck as far as I know and are better off keeping track of it yourself.

Share this post


Link to post
Share on other sites
The best way is to structure your code such that you know that BeginScene has been called. All of your rendering should be in one place really (Or in one Render() function for each object called from one place), so you should be able to just call BeginScene() (And check it succeeds!), render, then call EndScene().

If you need to know if BeginScene() has been called or not, then you most likely need to restructure your code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!