• Advertisement
Sign in to follow this  

GetTransform ? ? ?

This topic is 4874 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 needing to get the view matrix, so I'm using the following :
D3DXMATRIX matView;
CSGDirect3DManager::GetInstance()->GetDevice()->GetTransform( D3DTS_VIEW, &matView );


But this isn't giving me back the correct view matrix within my object render class ? The view is set each time the camera moves, any ideas what I could be doing wrong ? Any help is really appreciated. Steve

Share this post


Link to post
Share on other sites
Advertisement
Many thanks Pipo,

I was using a pure device (D3DCREATE_PUREDEVICE), what is this anyway ?

Best regards,
Steve

Share this post


Link to post
Share on other sites
A pure device is a device that doesn't help you store set matrices and other states.

It relies on you to keep those. Not needing to store those will give a (small) speed boost as it doesn't need to check when setting a state/transform.

Share this post


Link to post
Share on other sites
Quote:
Original post by steg
Many thanks Pipo,

I was using a pure device (D3DCREATE_PUREDEVICE), what is this anyway ?

Best regards,
Steve



When D3DCREATE_PUREDEVICE is specified, D3D passes all calls and data you make directly through to the graphics device driver without doing anything else. With a traditional, non-PURE device, the D3D runtime does things like state caching (so you can use the Get* calls), software vertex processing, data reformatting, some feature emulation, etc.

With a PURE device, *everything* your application requires from D3D MUST be supported by your graphics hardware (or provided by it's driver).

In a well tuned, well behaved and bug free application, with a PURE device you can sometimes get a small performance boost because D3D does less work.

Only use PURE once your application works properly, AND when you definately don't require something from the D3D runtime.



As a side note, since you're calling SetTransform() somewhere, it's likely more efficient to store that matrix in a variable and use that rather than making GetTransform().

Share this post


Link to post
Share on other sites
Thanks all,

Simon - I was thinking exactly the same over storing the view matrix within the parent class.

Best regards,
Steve

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement