On 07.10.2006 14:57, Jens Granseuer wrote:
class NetBuffer : public MemBuffer {
public:
NetBuffer( int size );
~NetBuffer( void );
int Size( void ) const { return size; }
void *GetData( void ) const { return buffer; }
private:
int size;
void *buffer;
}
It looks like to do this properly we need NetBuffer to allocate
memory dynamically (so we can do history->Save( NetBuffer )).
However, the standard STL classes (vector, string) are not really
suited for this purpose since we also need raw data access for
the SDL_net API. Do we really need to implement our own buffer
class? Any clever ideas?
Jens