Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Building a view and controller layer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 metsfan   Members   -  Reputation: 459

Like
0Likes
Like

Posted 10 June 2012 - 09:55 PM

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, 10 June 2012 - 09:57 PM.


Sponsor:

#2 Narf the Mouse   Members   -  Reputation: 305

Like
0Likes
Like

Posted 11 June 2012 - 12:36 AM

How would you render a model?

#3 metsfan   Members   -  Reputation: 459

Like
0Likes
Like

Posted 11 June 2012 - 07:55 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS