Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Oct 2002
Offline Last Active Apr 02 2014 09:51 AM

Posts I've Made

In Topic: gui/game librarys FOR C++

30 December 2013 - 05:25 PM

Since it's C++, I'd suggest sfml over sdl.

In Topic: Renderer class design trouble

12 October 2013 - 12:08 PM

You call your render function from your game logic? That seems odd. It's usually done at or near the end of the game loop. Maybe you could keep a pActiveCamera that can be updated in your game logic to point to whichever camera you need, and then pass that pointer in to your render function.

In Topic: Using global variables - really so bad?

05 October 2013 - 11:52 AM

How do you handle your graphics? It may help to think about sound as another rendering system, using audio instead of video as a medium. How does your renderer know what to draw, and where? Do you feed it renderable objects? Does it poll a scene graph? A similar approach shouldn't be difficult to design for your audio system.

In Topic: How do I implement the singleton I describe without circular inclusion?

04 October 2013 - 12:24 PM

Because few people would consider a window to be a good candidate for singleton usage.

In Topic: Using global variables - really so bad?

03 October 2013 - 05:11 PM

An important question here is: does the global have a state that can be changed anywhere in the program? I suspect that a sound system would have state. Such globals are much more difficult to debug, because the problem can be anywhere in the code base, or even worse, the result of multiple lines of code that are widely separated.


It's much better to pass the object around where needed, and better still to have a sound rendering step as Alvaro mentioned, to restrict the scope of the object as much as possible.