title: Namespace for global variables
body: <p>I have variables I want accessible to all of my application. Is this bad practice? If so, why?</p>
  
  <pre><code>namespace Global
  {
      SDL_Window* window;
      SDL_Renderer* renderer;
      UI* new_view;
  }
  </code></pre>
  
  <p><strong>Another suggestion:</strong></p>
  
  <p>How about passing a pointer to the global variables to classes in the constructor and keeping it as a local variable?</p>
  
  <pre><code>class A
  {
      SDL_Renderer* m_renderer;
  
      A(SDL_Renderer* renderer);
  } 
  
  A::A(SDL_Renderer* renderer)
  {
      m_renderer = renderer;
  }
  </code></pre>