OpenGL multiple canvas support

This commit is contained in:
rextimmy 2016-12-14 22:01:18 +10:00
parent efab1299ca
commit 08c0195cba
4 changed files with 60 additions and 28 deletions

View file

@ -191,19 +191,21 @@ U32 GFXGLDevice::getTotalVideoMemory()
GFXWindowTarget *GFXGLDevice::allocWindowTarget( PlatformWindow *window )
{
AssertFatal(!mContext, "This GFXGLDevice is already assigned to a window");
GFXGLWindowTarget* ggwt = 0;
if( !mContext )
{
// no context, init the device now
init(window->getVideoMode(), window);
ggwt = new GFXGLWindowTarget(window, this);
ggwt->registerResourceWithDevice(this);
ggwt->mContext = mContext;
}
GFXGLWindowTarget* ggwt = new GFXGLWindowTarget(window, this);
return ggwt;
//first window
if (!mContext)
{
init(window->getVideoMode(), window);
ggwt->mSecondaryWindow = false;
}
else
ggwt->mSecondaryWindow = true;
ggwt->registerResourceWithDevice(this);
ggwt->mContext = mContext;
return ggwt;
}
GFXFence* GFXGLDevice::_createPlatformSpecificFence()