Enabling/Disabling viewport
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement