[.net] Problems with serializing in DirectX

Started by
0 comments, last by Bob Janova 18 years, 1 month ago
Hi! I have a problem when i want to save my tilebased maps. I've got a Tile class that i want to be serializable, but in that class I have another class instance from my SpriteClass. The problem is that I've got some DirectDraw code in that SpriteClass and it doesn't want to be serialized. I've put [Serializable] before the class and all that. So, is there some way to do this? or should I consider using StreamWriter instead of FileWriter and binaryFormatter?
Advertisement
You need to make the SpriteClass serialisable too. If there are DD fields in there that can't be serialised normally, you need to implement custom serialisation in your sprite class – look up ISerializable.

This topic is closed to new replies.

Advertisement