Jump to content
  • Advertisement
Sign in to follow this  
jagguy

directx c++

This topic is 4882 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 Have done some VB6 and directX8 and now I am looking at c++. in c++ in a sample directX program I see the variable LPDIRECT3D8. I want to know 1) how do you find out about this variable in help , I cant see this listed anywhere..what is it 2) variables types like this are being used as Pointers eg LPDIRECT3D8 myone... myone ->.... How can you do this as it isnt a pointer. thanks

Share this post


Link to post
Share on other sites
Advertisement
DirectX and many parts of windows commonly create pointer type aliases like this:

It's like they did this:

class IDirect3D8
{
};

typedef IDirect3D8 *LPDIRECT3D8;

so LPDIRECT3D8 is a "IDirect3D8 *". LP standing for Long Pointer, where the Long part is an old appendage from the days of 16 bit programming where pointers could be NEAR (16 bit), or FAR/LONG (32 bit)

You'll see LPCSTR all over windows which is a long pointer to a C string... or char *, and it's expecting the string to be null terminated.

Share this post


Link to post
Share on other sites
Sure it is.

Microsoft has the "wonderful" habit of typedef-ing pointers to LPCAPITOLSOMETHINGOROTHER. So anytime you see capitol LP at the front of a type, know that it's a pointer to the rest.

Generally google or msdn search is the best source of info for these sort of odd things.

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!