Pass the Renderer to the Context at construction time
TRAC #22000
Signed-off-by: Daniel Koch
Author: Shannon Woods
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1402 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index abf928b..3e7f6cf 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -36,10 +36,13 @@
namespace gl
{
-Context::Context(const gl::Context *shareContext, bool notifyResets, bool robustAccess)
+Context::Context(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess)
{
ASSERT(robustAccess == false); // Unimplemented
+ ASSERT(dynamic_cast<rx::Renderer9*>(renderer) != NULL); // D3D9_REPLACE
+ mRenderer = static_cast<rx::Renderer9*>(renderer);
+
mDisplay = NULL;
mDevice = NULL;
@@ -4373,9 +4376,9 @@
extern "C"
{
-gl::Context *glCreateContext(const gl::Context *shareContext, bool notifyResets, bool robustAccess)
+gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess)
{
- return new gl::Context(shareContext, notifyResets, robustAccess);
+ return new gl::Context(shareContext, renderer, notifyResets, robustAccess);
}
void glDestroyContext(gl::Context *context)