Skip to main content
GameDev.net gamedev.net
🔒 Locked

GetTransform ? ? ?

Started by steg Oct 17, 2004 at 4:16 AM 4 replies 550+ views
Original Post
steg
steg
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
If it isn't working, take a bath, have a think and try again...
Pipo DeClown
Pipo DeClown
AFAIK, the Getxxx functions cannot be used with a pure device.. Are you using one?
steg
steg
Many thanks Pipo,

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

Best regards,
Steve
If it isn't working, take a bath, have a think and try again...
Endurion
Endurion
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.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
S1CA
S1CA
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().

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
steg
steg
Thanks all,

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

Best regards,
Steve
If it isn't working, take a bath, have a think and try again...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.