Jump to content
  • Advertisement
Sign in to follow this  
metsfan

Building a view and controller layer

This topic is 2226 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all. I am considering how I want to handle the view and controller layers of my game engine, and I just wanted to get some opinions on my thought process. I have been working a lot with iOS lately, and I have come to really like their model for views and controllers. For those who dont know, the way views and controllers work in iOS is that the UI is controlled by UIViewControllers. Each UIViewController has one root view, and an unlimited hierarchy of subviews can be created and added as children to the root view. The UIViewController is responsible for building the view, and making the calls to render the view, as well as the option of handling events on its view (the UIView can also handle its own events).

My question is, does this seem like a good logical base for a game engine as well? Each "View" in the game, such as the main 3d scene, the options panel, the login screen, each of these would have a GameController, and attached to each GameController would be a root GameView. Each GameController builds its subviews, and then the root view of the controller is added to the root GameController's view, which is essentially just a root node. Then on each render pass, the view hierarchy is traversed, and each view is rendered.

Not sure if this is making sense by this point, but if you're still with me, I'm wondering if there is anything that is obviously wrong with this architecture, whether its something small or big. I'd appreciate any opinions on the matter, and if there are any questions I will be happy to clarify. Edited by metsfan

Share this post


Link to post
Share on other sites
Advertisement

How would you render a model?


The main 3d scene controller would have a scene graph, and one of the node types in the scene graph would be a Mesh node. At least thats how I'm thinking about it now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!