LPDIRECT3d vs IDirect3D

Started by
4 comments, last by Thors1982 17 years, 10 months ago
just wondering whats the differnce between using IDirect3D9 *g_pD3D LPDIRECT3D9 g_pD3D
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.
____________________________________Spazuh- Because I've had too much coffee
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 *.
"Morituri Nolumus Mori"
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
How are you passing the device in SetTransform?
____________________________________Spazuh- Because I've had too much coffee
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

This topic is closed to new replies.

Advertisement