Improvements to openvr code

- Overlays are implemented (sans input for the moment)
- Fixed a problem where the movemanager was using the wrong values for hmd rotation & position
This commit is contained in:
James Urquhart 2016-05-14 23:51:04 +01:00
parent 185fde8ea4
commit da6bcbeb2b
13 changed files with 380 additions and 32 deletions

View file

@ -67,12 +67,6 @@ GFXLockedRect *GFXD3D11TextureObject::lock(U32 mipLevel /*= 0*/, RectI *inRect /
D3D11_MAPPED_SUBRESOURCE mapInfo;
/*if (!mProfile->canModify())
{
AssertFatal(false, "Tried to modify external texture");
return NULL;
}*/
if( mProfile->isRenderTarget() )
{
//AssertFatal( 0, "GFXD3D11TextureObject::lock - Need to handle mapping render targets" );
@ -186,8 +180,8 @@ bool GFXD3D11TextureObject::copyToBmp(GBitmap* bmp)
// check format limitations
// at the moment we only support RGBA for the source (other 4 byte formats should
// be easy to add though)
AssertFatal(mFormat == GFXFormatR8G8B8A8, "copyToBmp: invalid format");
if (mFormat != GFXFormatR8G8B8A8)
AssertFatal(mFormat == GFXFormatR8G8B8A8 || mFormat == GFXFormatR8G8B8A8_LINEAR_FORCE, "copyToBmp: invalid format");
if (mFormat != GFXFormatR8G8B8A8 && mFormat != GFXFormatR8G8B8A8_LINEAR_FORCE)
return false;
PROFILE_START(GFXD3D11TextureObject_copyToBmp);
@ -203,7 +197,7 @@ bool GFXD3D11TextureObject::copyToBmp(GBitmap* bmp)
const U32 sourceBytesPerPixel = 4;
U32 destBytesPerPixel = 0;
if(bmp->getFormat() == GFXFormatR8G8B8A8)
if (bmp->getFormat() == GFXFormatR8G8B8A8 || bmp->getFormat() == GFXFormatR8G8B8A8_LINEAR_FORCE)
destBytesPerPixel = 4;
else if(bmp->getFormat() == GFXFormatR8G8B8)
destBytesPerPixel = 3;