Reference to Pointer Problems
I have a question that probably has a simple answer, but I am still really new to this. The problem is I have my pointers as members of an object called ''dx'' that I tried to wrap up a little. I had things working before, but I want to learn what I am doing wrong, and not just do things the easy way! =P
class CDX8 {
public:
LPDIRECT3D8 pD3D;
LPDIRECT3DDEVICE8 pDevice;
D3DCAPS8 *pCaps;
D3DPRESENT_PARAMETERS PP;
D3DDISPLAYMODE Mode;
...
CDX8 dx; // Constructor sets everthing NULL then I initialize it
...
this->pD3D = Direct3DCreate8(D3D_SDK_VERSION);
This works fine, the actual code tests it and its not NULL after the call...
if(FAILED(this->pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, g_hMainWin, D3DCREATE_HARDWARE_VERTEXPROCESSING, &PP, &pDevice ) ) ) {return E_FAIL; }
The problem comes when I have to use the references to pDevice, and more than likely PP. Not knowing, I just assumed that I could use &this->pDevice, but this is not so. I''ve tinkered with it over and over and can''t seam to get it to work or find any help with it.
If anyone can point my pointers in the right direction, it would be most appreciated! =)
Don''t mind me, I answered my own problem and it had to do with my own stupidity as I guessed! =) I was passing invalid Present Parameters because I was only grabbing the Display mode in full screen and not for windowed mode. I guess from suffling things enough to make a wrapper I managed to break the continuity =)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement