Instruction Manual
virtual void restoreGuts(RWvistream& s);
virtual void restoreGuts(RWFile&);
virtual void saveGuts(RWvostream& s) const;
virtual void saveGuts(RWFile&) const;
private:
RECT bounds; // The bounds of the rectangle
};
An Excerpt from SHAPES.CPP
For the purposes of this DLL demo, it really isn't necessary to provide definitions for any of the
member functions inherited from RWCollectable, but let's do it anyway, for the sake of
completeness.
#include "shapes.h"
#include <rw/vstream.h>
#include <rw/rwfile.h>
RWDEFINE_COLLECTABLE(RWRectangle, 0x1000) //1
// Constructor
RWRectangle::RWRectangle(int l, int t, int r, int b) //2
{
bounds.left = l;
bounds.top = t;
bounds.right = r;
bounds.bottom = b;
}
// Inherited from Drawable:
void
RWRectangle::drawWith(HDC hdc) const //3
{
// Make the Windows call:
Rectangle(hdc, bounds.left, bounds.top,
bounds.right, bounds.bottom);
}
// Inherited from RWCollectable:
unsigned
RWRectangle::hash() const //4
{
return bounds.left ^ bounds.top ^ bounds.bottom ^ bounds.right;