I am not much a graphics guy so I don't know off-hand where you ultimately want to go with this. But that said,
(1) The demo class seems basically useless. It seems properly like you want to rename it something like a Device class. Keep your variables protected (or more likely private unless there is some reason who haven't specified for them being protected) and create some public methods which use those variables.
(2) Again, being graphics ignorant, is render something that belongs to the Device, or a subclass of Device, or is it truly independent of the device? If it really is independent then passing the Device into a Render object is an ok way to go. But honestly, just on instinct, it seems that Render is something that a device *does*, not something that is independent.
So off the top of my head:
(1) set up a Device interface
class BaseDevice
{
public:
BaseDevice();
virtual ~BaseDevice();
virtual void doSomething() = 0;
virtual void doOtherThing() = 0;
virtual void render() = 0;
}
(2) Make a concrete Device class.
class Device : public BaseDevice
{
public:
Device();
virtual ~Device();
virtual void doSomething();
virtual void doOtherThing();
virtual void render();
private:
LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 d3ddev;
}
void Device::render()
{
d3d.paintFancyStuff();
}
Basically I think you need to think your class hierarchy out more carefully. As a general rule your classes are going to be nouns, not verbs. Group common functionality of a class hierarchy into an interface and then have concrete classes implement the functionality.