Sign in to follow this  
cplimpa

Enabling/Disabling viewport

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this