diff options
| author | Jason Maskell <[email protected]> | 2016-05-16 16:31:40 +0200 |
|---|---|---|
| committer | Jason Maskell <[email protected]> | 2016-05-16 16:31:40 +0200 |
| commit | 35fb54cc684bd78ebb15ea64705396bcef53ff4f (patch) | |
| tree | c437f7e2ce02fc7e98d2e7bd0943cdc92fe17b5d /test | |
| parent | Added the test_d3d11 app to the solution. Not compiling yet, mostly a paranoi... (diff) | |
| download | waveworks_archive-35fb54cc684bd78ebb15ea64705396bcef53ff4f.tar.xz waveworks_archive-35fb54cc684bd78ebb15ea64705396bcef53ff4f.zip | |
Added the ability to specify the "media" directory for the test project.
test_d3d11 now runs, but doesn't work yet.
Converted foam.dds to 32 bit to let it actually load since it's 24 bit format was deprecated.
Diffstat (limited to 'test')
| -rw-r--r-- | test/d3d11/ocean_cufft_app.cpp | 9 | ||||
| -rw-r--r-- | test/d3d11/ocean_surface.cpp | 9 | ||||
| -rw-r--r-- | test/media/foam.dds | bin | 1048703 -> 5592528 bytes | |||
| -rw-r--r-- | test/testing_src/testing.h | 5 |
4 files changed, 18 insertions, 5 deletions
diff --git a/test/d3d11/ocean_cufft_app.cpp b/test/d3d11/ocean_cufft_app.cpp index af79315..bee9978 100644 --- a/test/d3d11/ocean_cufft_app.cpp +++ b/test/d3d11/ocean_cufft_app.cpp @@ -46,6 +46,9 @@ #include <tchar.h> #include "DDSTextureLoader.h" +#include <locale> +#include <codecvt> +#include <xlocbuf> //#define DEBUG_VS // Uncomment this line to debug vertex shaders //#define DEBUG_PS // Uncomment this line to debug pixel shaders @@ -92,7 +95,7 @@ GFSDK_WaveWorks_Simulation_Stats g_ocean_stats_simulation; GFSDK_WaveWorks_Simulation_Stats g_ocean_stats_simulation_filtered; int g_max_detail_level; -bool g_RenderWireframe = false; +bool g_RenderWireframe = true; bool g_RenderWater = true; bool g_SimulateWater = true; bool g_ForceKick = false; @@ -254,6 +257,10 @@ INT WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR cmdline, int ) g_pTestParams = new TestParams(cmdline); + std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter; + + DXUTSetMediaSearchPath(converter.from_bytes(g_pTestParams->MediaDirectory).c_str()); + // Set the callback functions. These functions allow DXUT to notify // the application about device changes, user input, and windows messages. The // callbacks are optional so you need only set callbacks for events you're interested diff --git a/test/d3d11/ocean_surface.cpp b/test/d3d11/ocean_surface.cpp index b382eae..8c86025 100644 --- a/test/d3d11/ocean_surface.cpp +++ b/test/d3d11/ocean_surface.cpp @@ -274,7 +274,7 @@ HRESULT OceanSurface::init(const OceanSurfaceParameters& params) if(NULL == m_pCubeMap) { TCHAR path[MAX_PATH]; - V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("..\\Media\\reflect_cube.dds"))); + V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("reflect_cube.dds"))); ID3D11Resource* pD3D11Resource = NULL; @@ -286,7 +286,7 @@ HRESULT OceanSurface::init(const OceanSurfaceParameters& params) if(NULL == m_pFoamIntensityMap) { TCHAR path[MAX_PATH]; - V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("..\\Media\\foam_intensity_perlin2.dds"))); + V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("foam_intensity_perlin2.dds"))); ID3D11Resource* pD3D11Resource = NULL; V_RETURN(DirectX::CreateDDSTextureFromFile(m_pd3dDevice, static_cast<const wchar_t *>(path), &pD3D11Resource, &m_pFoamIntensityMap)); // V_RETURN(m_pd3dDevice->CreateShaderResourceView(pD3D11Resource, NULL, &m_pFoamIntensityMap)); @@ -296,7 +296,7 @@ HRESULT OceanSurface::init(const OceanSurfaceParameters& params) if(NULL == m_pFoamDiffuseMap) { TCHAR path[MAX_PATH]; - V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("..\\Media\\foam.dds"))); + V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("foam.dds"))); ID3D11Resource* pD3D11Resource = NULL; V_RETURN(DirectX::CreateDDSTextureFromFile(m_pd3dDevice, static_cast<const wchar_t *>(path), &pD3D11Resource, &m_pFoamDiffuseMap)); // V_RETURN(m_pd3dDevice->CreateShaderResourceView(pD3D11Resource, NULL, &m_pFoamDiffuseMap)); @@ -398,7 +398,8 @@ void OceanSurface::renderShaded(ID3D11DeviceContext* pDC, const XMMATRIX& matVie m_pRenderSurfaceWaterColorVariable->SetFloatVector((FLOAT*)&m_params.waterbody_color); // Matrices - XMMATRIX matVP = matView * matProj; + XMFLOAT4X4 matVP; + XMStoreFloat4x4(&matVP, matView * matProj); m_pRenderSurfaceMatViewProjVariable->SetMatrix((FLOAT*)&matVP); D3D11_VIEWPORT vp; diff --git a/test/media/foam.dds b/test/media/foam.dds Binary files differindex 3a8a232..d2481a3 100644 --- a/test/media/foam.dds +++ b/test/media/foam.dds diff --git a/test/testing_src/testing.h b/test/testing_src/testing.h index 3537d3e..9620aa4 100644 --- a/test/testing_src/testing.h +++ b/test/testing_src/testing.h @@ -53,6 +53,7 @@ struct TestParams bool UseReadbacks; GFSDK_WaveWorks_Simulation_DetailLevel QualityMode; std::string ScreenshotDirectory; + std::string MediaDirectory; explicit TestParams(std::string strCommandLine) : UseReadbacks(false) @@ -108,6 +109,10 @@ struct TestParams m_shouldTakeScreen = true; ScreenshotDirectory = std::string(keyValuePair[1]); } + else if (keyValuePair[0] == "mediadir") + { + MediaDirectory = std::string(keyValuePair[1]); + } else if( keyValuePair[0] == "noaa" ) { m_allowAA = false; |