directx c++

Started by
3 comments, last by fg_brian 19 years, 2 months ago
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
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.
Edit: /killself GOGOGO
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.
DirectX is up to level 9 right now, I believe.

This topic is closed to new replies.

Advertisement