• Advertisement

Archived

This topic is now archived and is closed to further replies.

Structure for global settings.

This topic is 5150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement