Jump to content
  • Advertisement
Sign in to follow this  
benzo

[D3D9] Switching from transformed to untransformed vertices

This topic is 4728 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'm doing a 2D RTS tile game with D3D9. The game has a set of menus before presenting the main game screen (the map). All menus (buttons, text fields...) are made with transformed vertices but the map screen uses untransformed vertices (mainly for scrolling). I thought that I could switch easily from transformed to untransformed vertices using the setFVF method. But it doesn't work: if I start the game by using the menus, then the map screen, the menus are shown but not the map. If I display the map directly (and so not setting transformed vertices first and then untransformed), the same code works and the map is displayed. My question is: What are the steps to switch from transformed to untransformed vertices?

Share this post


Link to post
Share on other sites
Advertisement
It is as simple as setting the appropriate Vertex Format/Declaration.
If you have menu components that overlay the menu etc you will have to keep that in consideration. Make sure that you are using the correct vertex buffers and switching/setting them appropriately. Actually I am just hitting in the dark here as I can't see your code. It would be very helpfull and a screenshot too if that makes the situation/scenario a little bit clearer.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Theres also an issue with the stride size. Remember that transformed vertices are 4 floats and untransformed are 3 floats. This causes the stride size to change when switching modes.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!