mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Remove #defines for singleton instances #55

Closed mspraggs closed 9 years ago

mspraggs commented 9 years ago

I know this reduces the number of characters we have to type, but the same thing could be achieved by assigning a reference to the singleton instance to a local variable, e.g.:

void someFunc()
{
    Window& window = Window::instance();
    window.someWindowFunc();
}

What's the point in doing this? Debuggers can't resolve preprocessor statements, so if you try to do print WINDOW in something like gdb, it won't work.

Addresses #6

mspraggs commented 9 years ago

This is done and pushed.