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

  • Home
  • SEARCH
  • 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 235525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:16:19+00:00 2026-05-11T20:16:19+00:00

In an object-oriented programming style does how does one tend to handle graphics? Should

  • 0

In an object-oriented programming style does how does one tend to handle graphics? Should each object contain its own graphics information? How does that information get displayed?

My experience with making graphical programs is limited, but I have tended to have the objects and the graphics be only loosely related. For instance, if I implemented a chess game I would tend to have a graphics object responsible for making the board, getting images for the chess pieces, loading them into a hash attached to names such as White_Queen, and then updating the screen whenever things changed. The changes themselves would be passed to the main game loop from the objects, and then to the graphics object. The piece objects would contain the name of the piece graphics they were attached to, in a string, but wouldn’t have any graphics information in them. Is this OOP? Is it good OOP?

What I am thinking about now is that since the project I am working on involves procedurally generated graphics (very, very simple ones), I could have the procedures stored in the objects and get the graphics object to read the procedures from objects passed to it. Would this be OOP? Would it be good?

In the real world, as I have come to know it, things do not contain graphics. Things contain properties and my brain interprets them. Blind people’s brains and the brains of hawks all interpret different objects differently. Is this OOP? Should I try to do it that way?

Hey, thanks for your help as usual!

z.

PS I am writing code in C for the nintendo DS. I’m drawing graphics by coloring pixels individually!

  • 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-11T20:16:19+00:00Added an answer on May 11, 2026 at 8:16 pm

    You have several questions in one. Hopefully this will help.

    Should each object contain its own graphics information? How does that information get displayed?

    Programmers tend to differentiate between the terms “graphics” and “graphical user interface” (GUI). Generally graphics mean static images (like photographs) or dynamic images (like video games), whereas GUI refers to the normal things you see in an application, such as windows, buttons, or menus. Are you referring to graphics or GUIs?

    There are several layers of abstraction between your program and getting an image on your monitor. On a Windows PC it usually comes down to calling Win32 or DirectX functions, which handle all the lowest layer stuff.

    I could have the procedures stored in the objects and get the graphics object to read the procedures from objects passed to it.

    You should not put your main functionality in the graphics code, or vice versa. Keep them distinct. This makes it much easier to, say, change the way your pieces look in a chess game, or maybe modify the rules without changing the user interface.

    As mentioned by Alex Martelli, the MVC architecture is a good way to separate the business logic (the way it works) from the presentation of your application (the way it looks). In MVC, the view is generally thought of holding the GUI, which may or may not have “graphics”.

    Is this OOP? Is it good OOP?

    It sounds to me like you need to get a better grasp on what object oriented design means. Since there are so many external resources on this topic, I suggest that you Google it. In the mean time, maybe you should just experiment and try different ways of programming your game, rather than worrying if it’s good design. You can figure out what works well and what doesn’t–you don’t need to get it perfect the first time!

    In the real world, as I have come to know it, things do not contain graphics.

    On a metaphysical level I suppose you’re correct… what we see is simply a representation of what is around us, electrical signals generated by photons hitting our retinas. When you write your program, you are simply trying to generate images which are meaningful to people. I’m not really sure where you could go with this.

    I’m drawing graphics by coloring pixels individually!

    Wouldn’t it be easier to use some graphics library to handle this stuff for you? That way you could just do things like DrawCircle() rather that doing all the pixels yourself. That said, you can learn a lot by implementing your own low level graphics library… just remember that you will spend a lot of time on the library rather than on the game itself.

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

Sidebar

Ask A Question

Stats

  • Questions 172k
  • Answers 172k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should be able to do it with something like… May 12, 2026 at 2:31 pm
  • Editorial Team
    Editorial Team added an answer Do you have a main.m? If you are using the… May 12, 2026 at 2:30 pm
  • Editorial Team
    Editorial Team added an answer What about something like this : update your_table set visible… May 12, 2026 at 2:30 pm

Related Questions

I'm a scientist working mostly with C++, but I would like to find a
I've got a pretty strong background in C-style languages. And have worked on several
I am trying to wrap my head around the idea of classes, data visibility
I'm writing an App that basically uses 5 business entities, A, B C, D

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.