Sign in to follow this  

Level data model, and (sfml) engine view [MVC question]

Recommended Posts

Hello, I have a semi philosophical semi practical question.
I need a code representation of level data. say I'm using C++ I have a "Level" struct storing layers, a layer is a grid of objects.
each object represents some kind of displayable sprite with a position, orientation, sprite id (e.g. lookup-able by filename using an external global sprite/images central manager...).
The issue is, storing the sprite ID is enough to store all properties (position/orientation etc) because the display engine (say SFML) has a copy of all this information.
So the question is, should the "LevelObject" structure store position, orientation, size... in its own structure and transfer to SFML when necessary using an "UpdateViewFromModel" function ?
Or should it suppose that this is dual property storing, and that it will cause confusion and incoherence at some point, because the View stores a copy of the Model. So we could consider the view as being the view and the model at the same time ?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this