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 6945073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:23:20+00:00 2026-05-27T13:23:20+00:00

So im struggling with the idea of implementing MVC pattern on a (lets say)

  • 0

So im struggling with the idea of implementing MVC pattern on a (lets say) game app. Im spending some serious time lately focusing on the MVC pattern and how it gets correctly implemented but when it comes to an openGL app.. everything gets confusing.

Most specifically it all messes up (for me) in the View section.
I know i could have a model of lets say like this:
A class spaceship with variables like health, ammo, origin etc
A viewController (or just controller?) that would handle user input and act accordingly based on Model info and throw results on “View”

But really what about View here..? How can i implement my View in an openGL application in a sense off ‘throw those polygons on my *view’. Is that even possible, does openGL work that way? Thing with it is that i could pick an empty project drop some lines of code and have my projected triangle on screen with no need of an MVC design pattern. But i really want to work based on an mvc pattern because i figured out that you really go against the framework, i mean you really do.

I would really appreciate some coding examples focused on the View part of a MVC openGL app and also some further explanation so i can grasp the idea better.

Thank you for reading this, double thank you for answering!

  • 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-05-27T13:23:21+00:00Added an answer on May 27, 2026 at 1:23 pm

    I’m not sure if MVC works exactly the same in all languages/communities. But here’s how I understand it to work in the Mac/iOS world:

    Your model is responsible for storing data (eg: amount of ammo left in the ship) and manipulating data (eg: reducing the amount of ammo left in the ship).

    Your view is responsible for screen drawing and also responsible for all user interaction. I think you’ve missed that lass part (eg: the view draws a spaceship and watches for the spacebar key press event so it can send a fireGun: message to it’s delegate – which is a controller).

    The controller is for anything and everything else. In particular, the model and the view don’t really talk to each other much (within reason), instead they talk to the controller and the controller talks to both the model and the view (for example, the controller recieves a fireGun: message, checks if there’s enough ammo left in the model, then decreases the ammo by one, and tells the view to draw a bullet fire animation).

    Note that this does not actually split your code into three individual classes. Rather your code has many classes, each one of which fits into one of those three jobs. Multiple models, multiple views, multiple controllers.

    I’m not familiar with OpenGL, never done game programming so all my views have been using the standard/simple screen drawing API’s. However your view would have an internal data structure describing what is currently drawn on the screen, and it would draw exactly what’s in it. This data structure would be much simpler and faster than the model. It only contains what is actually visible, and nothing else (eg: it’d have a spaceship in it’s data structure, but not wouldn’t know anything about the spaceship such as how much ammo it has left right now).

    Sometimes a view will receive user interaction and process it without interacting with the controller at all. For example NSTextView is able to move the insertion point around on the screen without talking to it’s controller or the model.

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

Sidebar

Related Questions

I am struggling with the idea of getting CustomView from another application. Lets say
I've been struggling to automate the deployment of my asp.net mvc app. I found
Possible Duplicate: Highlight keywords in a paragraph I have been struggling with the idea
I am struggling to convince myself which idea is better. Any advice would be
Hello I am struggling with simple problem. General idea: class Foo(){ public boolean method1();
I'm struggling to get association right on Grails. Let's say I have two domain
I am struggling with an idea I want put into a python script. I'm
I'm still struggling a bit with the idea of ARC. Let's suppose I have
I've been struggling with this for hours and i have no idea why is
I love the idea of MVVM but really struggling with the hoop-jumping required for

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.