From: Joerg H. <jo...@lu...> - 2008-03-30 23:19:38
|
Hi, [...] > I dislike those variables flying around in nothing. Furthermore I > initially wanted to name the global instance of the SDLDriver driver but > did not do this because I feel that in a racing game a variable named > 'driver' is utterly confusing. It is now input driver which is not > completely correct since the SDLDriver cares about the screen setup as well. *giggle* I was smiling about input_driver->toggleFullscreen :) But I knew/suspected the reason for chosing that name. > I therefore propose to make use of C++ namespaces and put the often used > globals into it. This would make source code a bit longer (e.g. > user_config may become Globals::user_config or something like that) but > would make it IMHO more readable. I personally wouldn't do it, since it's a lot of stupid typing work :) Most global variables are called *_manager anyway (and the three or so remaining could be renamed, e.g. loader -> load_manager, ... - which would be a lot less work). But if you are happy enough to do this, I certainly won't object, since it's the clearest solution. Cheers, Joerg |