Enabling/Disabling viewport

Started by
0 comments, last by jollyjeffers 15 years, 8 months ago
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.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement