Sign in to follow this  
jagguy

directx c++

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this