Browse Source

Update OGLGraphicsImpl.h

Added function GetGLContext().

This allows us to switch multiple contexts like so:

    auto graphics = _context->GetSubsystem<Urho3D::Graphics>();
    auto graphicsImpl = graphics->GetImpl();
    				
    SDL_GL_MakeCurrent(graphicsImpl->GetWindow(), graphicsImpl->GetGLContext());
    _engine->RunFrame();
thebluefish 10 years ago
parent
commit
c3d5df1ea4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Source/Urho3D/Graphics/OpenGL/OGLGraphicsImpl.h

+ 3 - 1
Source/Urho3D/Graphics/OpenGL/OGLGraphicsImpl.h

@@ -103,7 +103,9 @@ public:
     GraphicsImpl();
     /// Return the SDL window.
     SDL_Window* GetWindow() const { return window_; }
-
+    /// Return the GL Context.
+	const SDL_GLContext& GetGLContext() { return context_; }
+	
 private:
     /// SDL window.
     SDL_Window* window_;