hi guys
ok, I''m wondering how I should use these two features, I have a good idea of normal inheritance that most people use, so I''ll explain my class heirarchy....
class PixelBuffer
class DXPixelBuffer, virtual public PixelBuffer
class ImagePixelBuffer, virtual public PixelBuffer
class DXImagePixelBuffer, public ImagePixelBuffer, public DXPixelBuffer
so, ill give you an explanation of what each class is supposed to be doing
PixelBuffer is the base class of the whole system, all are derived from this base class
DXPixelBuffer inherits the interface from PixelBuffer and implements the actual buffer object, this is a DirectDraw system, so it''s using IDirectDrawSurface7 *surface''s
ImagePixelBuffer inherits and extends the PixelBuffer object by giving you one extra function, LoadImage, this has the following function prototype:
virtual bool LoadImage(char *filename, char *dll_filename);
filename, obviously
![](smile.gif)
means the filename of the Image you want to load, the dll_filename means the dll you request to load the file for you, you basically ask the dll for a handle to a file, it''ll read your filename, read/open/decode and pass back through a inherited class object the data contained in the file, please, it gets a little more complex than that, I dont think you need to know the dirty work
![](smile.gif)
DXImagePixelBuffer has to multiply inherit both those two classes, because firstly the object needs PixelBuffer capabilities, which is fine, but unless I plan to put the implementation in the DXImagePixelBuffer class, I have to inherit from a lower class which already implements, it, hence DXPixelBuffer rather PixelBuffer, inheriting ImagePixelBuffer is just like normal, the implementation of ImagePixelBuffer is done in the DXImagePixelBuffer class.
ok, was that clear enough?
right, ok, now, does that heirarchy look ok to you? or does it look wrong?
right, now saying that, I think there is something wrong, do any of you know what the fuck _purecall() is ? well, when I try to construct an object of type DXImagePixelBuffer, assigning it to a ImagePixelBuffer ptr, the ImagePixelBuffer and DXImagePixelBuffer''s vtable gets filled with this _purecall() function, not knowing what this means, I''m stumped, can anyone else explain why I''m getting that function inserted rather than my normal functions I''ve defined in my classes ?
I reckon it''ll take someone here about 10 seconds to find out where I''ve gone wrong, this is my first real attempt at this, so if you can help me out, that''d be great, thanks !
kosh
if understanding it made and born with time, then time, is understandings greatest enemy.....