• Advertisement

Archived

This topic is now archived and is closed to further replies.

Whats the diffrence whit these...

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

I realized that theres is: IDIRECTDRAWSURFACE7 AND DIRECTDRAWSURFACE7 And so far im been using the first one, so can somebody tell whats the idea of having two of them? Only diffrence i found was that the second one has more drawing functions.

Share this post


Link to post
Share on other sites
Advertisement
The "I" means that it''s an interface. This is not normally used very much. But in the world of COM objects you can sometimes use it to create a usable variable.

In C++ you would use
LPDIRECT3DTEXTURE8 myTexture; //same principle as for your surface

This would create a variable holding your texture object.

But if you were to create it using COM like you have to do with DirectX Audio.

CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**)&g_pLoader);

You could actually use this to create myTexture also but it seems like it''s a better idea to do like I have showed above . So in short you seldom use the "I" objects as a beginner.



Share this post


Link to post
Share on other sites
quote:
Original post by WonderWorld
This is not normally used very much.

considering that every com object exposes at least one interface, it is used very much.

IDirect3D8, IDirect3DDevice8, and all the others are com interfaces implemented and exposed by directx for your use.

lpdirect3dtexture8 is a typedef for idirect3dtexture8 *, as are all others lpdirectxxx typedefs.

Share this post


Link to post
Share on other sites
Yeah, I dont use the LP_ versions of any of them, I use all the I_ interface versions and do the pointer myself... just looks better.

Share this post


Link to post
Share on other sites
quote:
Original post by elis-cool
Yeah, I dont use the LP_ versions of any of them, I use all the I_ interface versions and do the pointer myself... just looks better.

better yet, use smart pointers (CComPtr) and never again call Release().

Share this post


Link to post
Share on other sites

  • Advertisement