Jump to content
  • Advertisement
Sign in to follow this  
cplimpa

Enabling/Disabling viewport

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

Hello, The question: i'm porting some code from Xbox 360 to PC anything was good until i found this line: pDevice->SetRenderState( D3DRS_VIEWPORTENABLE, FALSE ); In PC DirectX 9 there is no such state. Xbox version help says: TRUE to enable the viewport transformation. Setting this value to FALSE will disable the matrix multiply portion of the viewport transformation. The divide-by-w portion of the viewport transformation will still occur. Accordingly, you should set the w component of your position vector to 1.0 to avoid modifying the x, y, and z components. The default value is TRUE. So, i have to write my own function for that? I'm right ? If so, how to easy implement it? Thanks. Ojars.

Share this post


Link to post
Share on other sites
Advertisement
The viewport transformation matrix is a bit hidden away really - quite important yet not immediately obvious imo.

MSDN search is, unsurprisingly, being a complete PITA to find anything on but this page for D3D Mobile has the following diagram for the viewport matrix:



From your description I would imagine that you can construct a D3DVIEWPORT9 that'd generate the identity matrix and thus effectively disabling the viewport transformation...

hth
Jack

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!