Skip to main content
gamedev.net
🔒 Locked

Structure for global settings.

Started by kvinther Jan 13, 2004 at 11:10 AM 1 replies 300+ views
Original Post
kvinther
kvinther
What is a good way to have global variables over several files. If I for example have a large project, where many functions need to access gui-vars... I was thinking in the line of a STRUCT. But how do several files share a single variable?
kuphryn
kuphryn
It is a matter of design. Post more information about the design. Are you referring to global functions? Are they members functions of some classes?

Kuphryn
kvinther
kvinther
It is a matter of design, you say. I guess you couldn''t be more right - a fundamental rule of programming. Perhaps I should have started by doing the following sketch:

http://project.kvit.net/files/SceneDesign.pdf

So far, only Main and Scene makes use of the UI-Settings. I guess passing a pointer to the UI or directly to the Settings when creating a Scene object, would do the trick?

Topic Locked

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

Sign in to reply to this topic.