Issue With Direct3D's Direct3DCreate9()

closed account (zb0S216C)
If you've used Direct3D 9 before, you'll know that you need a Direct3D context in order to create a Direct3D device. This is exactly what I've done, but Direct3DCreate9() doesn't want to co-operate.

This is my code:

1
2
3
4
5
6
7
8
9
10
11
12
class Framework
{
    public:
        Framework() 
            : M_D3D_(0x0) 
        {
            this->M_D3D_ = Direct3DCreate9(D3D_SDK_VERSION); // A
        }

    private:
        IDirect3D9 *M_D3D_;
};

The line marked "A" is giving me a segmentation fault, and I don't know why. I've tried googling it, but found nothing of use. Am I missing something before the creation of the Direct3D context?

Ideas?

Also, while I'm here: recently, I posted a question regarding a message loop in a Win32 application. How should a message loop inside a Direct3D application?

Thanks :)

Wazzak
Last edited on
Topic archived. No new replies allowed.