Globally shared data has to be global?

Started by
0 comments, last by fpsgamer 16 years, 6 months ago
I have just encountered a design problem that forces me to use a globally shared data. Be it wrapped in a class or not, it's gonna have to be made globally accessible. Well, here's the deal: The Video accepts some configurations that are set on construction. Such can be double buffering, full screen mode, alpha blending, et caetera. My only issue is with alpha blending, since it's the only configuration that my implementation would have to know about. I am using SDL, so I must know if I have to pass that SDL_SRCALPHA flag to each surface creation and if I have to map RGB or RGBA color values, but I think that last one won't matter much, since alpha would be ignored on blitting. The only idea I came up was to have static members on Video that could give me that information (alpha enabled or not). This seems like a design flaw and I need some help at this point.
Advertisement
Declare the "global" inside a different namespace or utilize a static member (as you previously mentioned)

This topic is closed to new replies.

Advertisement