• Advertisement
Sign in to follow this  

LPDIRECT3d vs IDirect3D

This topic is 4269 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

Advertisement
I don't believe that there is a difference. They both compile with no errors.
Not even sure why there are two, but I never really liked the first convention, so I guess someone at MS didn't either.

Share this post


Link to post
Share on other sites
There is no difference, as LPDIRECT3D9 is a simple typedef. You could argue that the DX interfaces aren't meant to be new/deleted, and from that point of view prefer the typedef I suppose, but personally, I find typedefing pointers away to be less clear style-wise (also I don't like caps ), so I use IDirect3D9 *.

Share this post


Link to post
Share on other sites
Thanks, was just curious cause I have been trying to pass my LPDIRECT3DDEVICE9 g_pd3dDevice to a function

and then do a simple operation like ->SetTransform on it.... and its not working, hehe

Share this post


Link to post
Share on other sites
passingmy function header:
BOOL Transformations(LPDIRECT3DDEVICE9 g_pd3dDevice)

inside the function I do this


D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f);
g_pd3dDevice->SetTransform(D3DTS_PROJECTION, &matProj);


it compiles correctly
but nothing appears on the screen (obviously i am passing g_pd3dDevice and doing more than just a transformation) that was just an example.

im not really sure whats wrong
and I can't debug it.... when i step through line by line... its saying int = 59,385 and its goign to lines that say return FALSE; yet its not even returning... im confused.

So I can't even see if my int is correct

Share this post


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

  • Advertisement