N
Nico Massi
i have a problem with my classes
i have a base class that defines the interface for a window ( abstract
class )
in a render device i have implemented the class for either Direct3D or
OpenGL
on the other hand i would implement the interface also for windows and
linux
my problem is now that the class WindowsWindow would inherit from the basic
window interface
but in runtime it must use either D3D or OGL window as base class( based on
the current render device )
so my class hierarchy would look like this
class window
{
/* data/interface here */
};
class windowGL : public window
{
};
class windowD3D : public window
{
};
class windowWindows : public window
{
};
the above hierarchy would work, but on runtime i need the window functions
of the windowWindows class for D3D or OGL based on the render device
( if it is a GL render device i would need the windowGL as base class,
otherwise windowD3D )
how can such a poblem solved?
i have a base class that defines the interface for a window ( abstract
class )
in a render device i have implemented the class for either Direct3D or
OpenGL
on the other hand i would implement the interface also for windows and
linux
my problem is now that the class WindowsWindow would inherit from the basic
window interface
but in runtime it must use either D3D or OGL window as base class( based on
the current render device )
so my class hierarchy would look like this
class window
{
/* data/interface here */
};
class windowGL : public window
{
};
class windowD3D : public window
{
};
class windowWindows : public window
{
};
the above hierarchy would work, but on runtime i need the window functions
of the windowWindows class for D3D or OGL based on the render device
( if it is a GL render device i would need the windowGL as base class,
otherwise windowD3D )
how can such a poblem solved?