aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/CAPI/D3D1X
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2014-08-11 21:18:59 -0700
committerBrad Davis <[email protected]>2014-08-11 21:18:59 -0700
commit04a03e83f135fbfccbc960b13e05729490ccd375 (patch)
tree7878b192a3fd24eb69f54744dc17f44f53b0ac1a /LibOVR/Src/CAPI/D3D1X
parent0f49ce8fc6aa54224e4c0d6fda8c4527ad39cce1 (diff)
Adding 0.4.1 windows files
Diffstat (limited to 'LibOVR/Src/CAPI/D3D1X')
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp14
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_HSWDisplay.cpp15
2 files changed, 13 insertions, 16 deletions
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp
index 1e4b11a..2fe3fee 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp
@@ -37,9 +37,6 @@ limitations under the License.
#include "../../Kernel/OVR_Allocator.h"
#include "../../Kernel/OVR_Color.h"
-
-#include "../Textures/healthAndSafety.tga.h"
-
// We currently borrow the SimpleQuad shaders
#include "../Shaders/SimpleTexturedQuad_vs.h"
#include "../Shaders/SimpleTexturedQuad_vs_refl.h"
@@ -324,7 +321,11 @@ void HSWDisplay::LoadGraphics()
#endif
if(!pTexture) // To do: Add support for .dds files, which would be significantly smaller than the size of the tga.
- pTexture = *LoadTextureTga(RenderParams, pSamplerState, healthAndSafety_tga, (int)sizeof(healthAndSafety_tga), 255);
+ {
+ size_t textureSize;
+ const uint8_t* TextureData = GetDefaultTexture(textureSize);
+ pTexture = *LoadTextureTga(RenderParams, pSamplerState, TextureData, (int)textureSize, 255);
+ }
if(!UniformBufferArray[0])
{
@@ -418,9 +419,6 @@ void HSWDisplay::LoadGraphics()
}
}
}
-
- // Calculate ortho projection.
- GetOrthoProjection(RenderState, OrthoProjection);
}
@@ -445,6 +443,8 @@ void HSWDisplay::RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture)
if(!pVB)
LoadGraphics();
+ // Calculate ortho projection.
+ GetOrthoProjection(RenderState, OrthoProjection);
// Save settings
// To do: Merge this saved state with that done by DistortionRenderer::GraphicsState::Save(), and put them in a shared location.
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_HSWDisplay.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_HSWDisplay.cpp
index 3daad5d..f001841 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_HSWDisplay.cpp
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D9_HSWDisplay.cpp
@@ -36,9 +36,6 @@ limitations under the License.
#include "../../Kernel/OVR_Allocator.h"
#include "../../Kernel/OVR_Color.h"
-#include "../Textures/healthAndSafety.tga.h"
-
-
namespace OVR { namespace CAPI {
@@ -233,7 +230,9 @@ void HSWDisplay::LoadGraphics()
if(caps.TextureCaps & (D3DPTEXTURECAPS_SQUAREONLY | D3DPTEXTURECAPS_POW2))
{ HSWDISPLAY_LOG(("[HSWDisplay D3D9] Square textures allowed only.")); }
- pTexture = *LoadTextureTga(RenderParams, healthAndSafety_tga, (int)sizeof(healthAndSafety_tga), 255);
+ size_t textureSize;
+ const uint8_t* TextureData = GetDefaultTexture(textureSize);
+ pTexture = *LoadTextureTga(RenderParams, TextureData, (int)textureSize, 255);
OVR_ASSERT(pTexture);
}
@@ -269,9 +268,6 @@ void HSWDisplay::LoadGraphics()
}
}
}
-
- // Calculate ortho projection.
- GetOrthoProjection(RenderState, OrthoProjection);
}
@@ -327,9 +323,10 @@ void HSWDisplay::RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture)
if(!pTexture)
LoadGraphics();
- HRESULT hResult;
+ // Calculate ortho projection.
+ GetOrthoProjection(RenderState, OrthoProjection);
- hResult = RenderParams.Device->BeginScene();
+ HRESULT hResult = RenderParams.Device->BeginScene();
if(FAILED(hResult))
{ HSWDISPLAY_LOG(("[HSWDisplay D3D9] BeginScene failed. %d (%x)", hResult, hResult)); }