Hi
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!