Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8640373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:15:52+00:00 2026-06-12T11:15:52+00:00

I consider to build a game engine with the following design approach. The principal

  • 0

I consider to build a game engine with the following design approach.

The principal characteristic is to create so called systems, which cover game menus and game levels. These systems are provided with objects like Window to draw, Input to fetch, Sound to play, and maybe Network to communicate with a server.

class System // abstract class
{
     Window* Window;
     Input* Input;
     ...

     System(Window* Window, Input* Input, ...)
     {
          this->Window = Window;
          this->Input= Input;
          ...
     }

     virtual Pause() = 0;
     virtual Resume() = 0;
}

The main function handles the systems thus menus and levels. Say LevelOne is derived from System.

int main()
{
     LevelOne Tutorial(&Window, &Input, ...); 
     Tutorial.Pause();
     ...
}

This way my code becomes structured and (in my opinion) easy to understand. But how could the main function communicate with the systems?

For example, how could the menu tell the main function that the user had selected a level, and which one? In order to let the main function delete the menu and create a new level object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:15:53+00:00Added an answer on June 12, 2026 at 11:15 am

    I think what you are trying to do here is organize a complete model-view-controller architecture, and the code you provided here is the model and controller portion of it. See some explanations on MVC on the web:

    http://www.codinghorror.com/blog/2008/05/understanding-model-view-controller.html

    If you have a single main() function trying to listen for messages from your subsystems and calling the appropriate actions as a result, you are trying to implement a single-threaded reactive message loop. You could consider running an ACE reactor that can listen for Qt GUI messages as well as others such as network events, then call your subsystems appropriately (though there may be some performance issues):

    http://www.cs.wustl.edu/~schmidt/PDF/reactor-rules.pdf

    I am not familiar with graphics engines for video game programming, but most graphics libraries offer a message loop for you during its initialization that doesn’t require you to go through this kind of detail. All you typically have to do is create your graphics objects and register them with the main message loop of the library.

    And I would recommend using a separate thread listening for network events compared to your message thread listening for graphics events. It separates the work out and helps to improve the performance of your graphics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following method, where I build a string and return it. I would
Consider the following PUT requests that build a CouchDB Database and add a document
Consider this simple python code, which demonstrates a very simple version control design for
I would like to ask you which automated build environment you consider better, based
Consider the following code... In my tests for a RELEASE (not debug!) x86 build
Consider having the following header file (c++): myclass.hpp #ifndef MYCLASSHPP_ #define MYCLASSHPP_ namespace A
Consider the following C#: // C# .net switch(x) { case 1: for(int i =
Consider the following URL: http://www.iamsomeweiredurl.fromsomewhere/andIwant#thisfragment Is there a chance to get thisfragment by @RequestMapping
Consider the following code: template <class x1, class x2 = int*> struct CoreTemplate {
Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.