Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualJvlonden

Posted 20 June 2013 - 10:25 AM

So if this is my class:

class MyClass
{
private:
	CComPtr<IDirect3DDevice9> d3ddev;

public:
	MyClass(IDirect3DDevice9 * _d3ddev)
	{
		this->d3ddev = _d3ddev;
	} 
};

And I would create an instance of it like this:

CComPtr<IDirect3DDevice9> d3ddev;

InitDevice()
{
    // d3ddev gets inititialized here
}

SomeFunction()
{
    InitDevice();
    MyClass myclass1(d3ddev);
}

Then that would be fine?


#2Jvlonden

Posted 20 June 2013 - 10:00 AM

So if this is my class:

class MyClass
{
private:
	CComPtr<IDirect3DDevice9> d3ddev;

public:
	MyClass(IDirect3DDevice9 * _d3ddev)
	{
		this->d3ddev = _d3ddev;
	} 
};

And I would create an instance of it like this:

CComPtr<IDirect3DDevice9> d3ddev;

InitDevice()
{
    // d3ddev gets inititialized here
}

SomeFunction()
{
    InitDevice();
    MyClass myclass1(d3ddev);
}

Than that would be fine?


#1Jvlonden

Posted 20 June 2013 - 10:00 AM

So if this is my class:

class MyClass
{
private:
	CComPtr<IDirect3DDevice9> d3ddev;

public:
	MyClass(IDirect3DDevice9 * _d3ddev)
	{
		this->d3ddev = _d3ddev;
	} 
};

And I would create an instance of it like this:

CComPtr<IDirect3DDevice9> d3ddev;

InitDevice()
{
    // d3ddev gets inititialized here
}

SomeFunction
{
    InitDevice();
    MyClass myclass1(d3ddev);
}

Than that would be fine?


PARTNERS