Jump to content
  • Advertisement
Sign in to follow this  
david w

LPDIRECT3DTEXTURE9* vs IDirect3DTexture9*

This topic is 3175 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'm confused on what the difference between the two are. It seems I can use them interchangeably. What is the recommend one to use? I think I may be failing to see the difference. If I load a texture into either pointer it works. Same for displaying them, with the Fixed Function Pipeline, or through a Shader. They "appear" to be identical in functionality.

Share this post


Link to post
Share on other sites
Advertisement
What your topic name lists probably isn't what you actually have.

A LPDIRECT3DTEXTURE9 is a typedef for IDirect3DTexture9*.

A LPDIRECT3DTEXTURE9* then would be equivalent to IDirect3DTexture9**.

edit: The only practical difference would be if you had:

LPDIRECT3DTEXTURE9 alpha, beta;

Then alpha and beta would both have the type IDirect3DTexture9*.

If you had:

IDirect3DTexture9* alpha, beta;

Then alpha would have the type IDirect3DTexture9* and beta would have the type IDirect3DTexture9. Pretty much any other explanation will boil down to style and personal preference.

Share this post


Link to post
Share on other sites
Infact both are not the same. The LP prefix of LPDIRECT3DTEXTURE9 stands for Long Pointer, old terminology. So its basically a pointer to IDirect3DTexture9. LPDIRECT3DTEXTURE9* would be a pointer to that pointer.

Share this post


Link to post
Share on other sites

typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9;


The LPDIRECT3DTEXTURE9 is a long pointer to the IDirect3DTexture9 interface.
You have also a PDIRECT3DTEXTURE9 witch is a pointer to it.

these 2 types are defined for backwards compatibilty with the old days of 16bit, but today (32 and 64bit) there is no difference between a Long Pointer and a Pointer so don't worry about it ;)

==> use the IDirect3DTexture9 one

Share this post


Link to post
Share on other sites
Quote:
Original post by Yourself
these 2 types are defined for backwards compatibilty with the old days of 16bit, but today (32 and 64bit) there is no difference between a Long Pointer and a Pointer so don't worry about it ;)
Of course, DirectX wasn't around in the 16-bit days so there's no backwards compatibility argument here... it's really just a style convention by Microsoft.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!