diff options
| author | Jason Maskell <[email protected]> | 2016-05-31 11:24:52 +0200 |
|---|---|---|
| committer | Jason Maskell <[email protected]> | 2016-05-31 11:24:52 +0200 |
| commit | 999fd20ca96b8d44d3ce418f118fb3b846038978 (patch) | |
| tree | fc86969d4eb006f592560e7bd425b9a2db865be2 /sample/d3d11/ocean_surface.cpp | |
| parent | Added path to opengl media search path. Removed commented out code left over ... (diff) | |
| download | waveworks_archive-999fd20ca96b8d44d3ce418f118fb3b846038978.tar.xz waveworks_archive-999fd20ca96b8d44d3ce418f118fb3b846038978.zip | |
Added support for RFC 104, the logging interface: https://docs.google.com/document/d/102b8k5pKYj9e-tMmG53aT5izur-qfUSPX1gBro4gN0Q/edit
Added a dumb implementation of the logger in the D3D11 sample.
Added a method to the WaveWorks API to allow the user to set (override) the internal logger with their own supplied nv::ILogger derived object.
Diffstat (limited to 'sample/d3d11/ocean_surface.cpp')
| -rw-r--r-- | sample/d3d11/ocean_surface.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sample/d3d11/ocean_surface.cpp b/sample/d3d11/ocean_surface.cpp index 4bd0dc6..3bf11c8 100644 --- a/sample/d3d11/ocean_surface.cpp +++ b/sample/d3d11/ocean_surface.cpp @@ -31,10 +31,11 @@ #include "ocean_surface.h" #include "GFSDK_WaveWorks_D3D_Util.h" +#include "../common/Logger.h" +#include "../common/LoggerImpl.h" #pragma warning(disable:4127) - OceanSurface::OceanSurface() { m_pOceanFX = NULL; @@ -72,8 +73,10 @@ OceanSurface::~OceanSurface() HRESULT OceanSurface::initQuadTree(const GFSDK_WaveWorks_Quadtree_Params& params) { + NV_LOG("Initing the QuadTree"); + if(NULL == m_hOceanQuadTree) -{ + { return GFSDK_WaveWorks_Quadtree_CreateD3D11(params, m_pd3dDevice, &m_hOceanQuadTree); } else @@ -148,13 +151,10 @@ HRESULT OceanSurface::init() if(NULL == m_pOceanFX) { - ID3DBlob* pEffectBuffer = NULL; - TCHAR path[MAX_PATH]; V_RETURN(DXUTFindDXSDKMediaFileCch(path, MAX_PATH, TEXT("ocean_surface_d3d11.fxo"))); - V_RETURN(D3DX11CreateEffectFromFile(path, 0, m_pd3dDevice, &m_pOceanFX));// pEffectBuffer->GetBufferPointer(), pEffectBuffer->GetBufferSize(), 0, pd3dDevice, &g_pEffect)); - SAFE_RELEASE(pEffectBuffer); + V_RETURN(D3DX11CreateEffectFromFile(path, 0, m_pd3dDevice, &m_pOceanFX)); // Hook up the shader mappings @@ -197,7 +197,7 @@ HRESULT OceanSurface::init() pShadedShoreReflectionHS->Release(); pShadedShoreReflectionDS->Release(); - m_pRenderSurfaceWireframeWithShorelinePass = m_pRenderSurfaceTechnique->GetPassByName("Pass_Wireframe_WithShoreline"); + //m_pRenderSurfaceWireframeWithShorelinePass = m_pRenderSurfaceTechnique->GetPassByName("Pass_Wireframe_WithShoreline"); } if(NULL == m_pQuadLayout) @@ -309,7 +309,7 @@ void OceanSurface::renderShaded( ID3D11DeviceContext* pDC, m_pOceanFX->GetVariableByName("g_BaseGerstnerWavelength")->AsScalar()->SetFloat( wavelength ); m_pOceanFX->GetVariableByName("g_BaseGerstnerSpeed")->AsScalar()->SetFloat( speed ); m_pOceanFX->GetVariableByName("g_BaseGerstnerParallelness")->AsScalar()->SetFloat( parallelness ); - m_pOceanFX->GetVariableByName("g_WindDirection")->AsVector()->SetFloatVector( &windDir.x ); + m_pOceanFX->GetVariableByName("g_WindDirection")->AsVector()->SetFloatVector( (FLOAT*) &windDir ); m_pOceanFX->GetVariableByName("g_DataTexture")->AsShaderResource()->SetResource( pDistanceFieldModule->GetDataTextureSRV() ); m_pOceanFX->GetVariableByName("g_Time")->AsScalar()->SetFloat( totalTime ); |