Skip to main content
gamedev.net
🔒 Locked

Programming Structure - help?

Started by carb Aug 16, 2003 at 12:23 AM 4 replies 600+ views
Original Post
carb
carb
I''m having quite a time figuring out how to lay out my classes in an engine I''m developing. I''ll lay out how I think it should work, but some problems which have arisen. One problem in particular eludes me ... It begins with an application class, which contains a variety of other classes ... right now, just a graphics one. See, I''m thinking of adding a "log" class, such that I can post problems to a log file. I want this kind of functionality in the graphics class as well, but not to a different file, to the same file. Does this mean I need to pass a pointer to the same instance of a log class to the graphics class? Or can I use extern in some silly way to accomplish this. Appreciate any help, - Ben
Ben
Naaga
Naaga
I would (and have before) pass the pointer.
__________America seems to like crap because its what we make popular. - Goober King
TSwitch
TSwitch
Wouldn''t you want a different log file for each of the systems? However you have your log system set up, I would make sure that you can have separate logs so that you don''t have to filter through hundreds of lines of video system output to find the couple of lines of network system output.
Member of the Unban nes8bit or the White Rhino in my Basement Gets Sold to the Highest Bidder Association (UNWRBGSHBA - Not accepting new members.)Member of the I'm Glad Mithrandir Finally Found an Association that Accepts People with his Past History Association (IGMFFAAPPHA)
Erkki
Erkki
I also suggest you read the "Enginuity" series of articles here at gamedev.net. They're very helpful for this kind of stuff.

[edited by - Erkki on August 16, 2003 8:39:25 AM]
carb
carb
I''ve been reading about Singletons ... how exactly do you access them from everywhere? That''s the part that I''m confused about.
Ben

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.