m_pD3D crash and burn

Started by
0 comments, last by Obolus 22 years, 10 months ago
Hey all! Up until just recently my prog had been running fine, then I decided to restructure it a bit and put the D3D device (m_pD3D) and the D3D Rendering device (m_pd3dDevice) into a class called CDirect3D_Devices. The idea was to make the devices accessable to any of my functions and classes that would want to render or load something using them. The class is tiny - it has only those two member variables, a constructor (which sets both of the D3D variables to "NULL") and a "CleanUp" function that releases them. Both member variables are public. When I ran the program it caused a general protection fault. Damn. The offending bit of code was the first line in the program where it accessed the m_pD3D variable of the Direct3D_Devices class. It just happened to be the one where Direct3DCreate is called on the object. I slapped in a NULL test before that line, and because this test accessed the m_pD3D object the program produced another GPF. I wondered if it was the m_pD3D object itself that was at fault, or the class that was accessing it, so I tried accessing it from another class and then from its own CDirect3D_Devices class, both times causing a GPF. I''m completely stumped, and I''m not well-versed enough in debugging and don''t know enough about the DX8 system to work out why it''s crashing. I hope someone can help me! Thanks, Gareth
Advertisement
You might want to post the offending code. It could just be a small typo.

Jim


Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8

This topic is closed to new replies.

Advertisement