diff options
| author | Jason Maskell <[email protected]> | 2016-05-09 10:39:54 +0200 |
|---|---|---|
| committer | Jason Maskell <[email protected]> | 2016-05-09 10:39:54 +0200 |
| commit | 79b3462799c28af8ba586349bd671b1b56e72353 (patch) | |
| tree | 3b06e36c390254c0dc7f3733a0d32af213d87293 /sample/d3d11/Effects11/d3dx11dbg.cpp | |
| download | waveworks_archive-79b3462799c28af8ba586349bd671b1b56e72353.tar.xz waveworks_archive-79b3462799c28af8ba586349bd671b1b56e72353.zip | |
Initial commit with PS4 and XBone stuff trimmed.
Diffstat (limited to 'sample/d3d11/Effects11/d3dx11dbg.cpp')
| -rw-r--r-- | sample/d3d11/Effects11/d3dx11dbg.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sample/d3d11/Effects11/d3dx11dbg.cpp b/sample/d3d11/Effects11/d3dx11dbg.cpp new file mode 100644 index 0000000..330e8d9 --- /dev/null +++ b/sample/d3d11/Effects11/d3dx11dbg.cpp @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11dbg.cpp +// Content: D3DX11 Effects debugging functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "pchfx.h" + + +#ifdef FXDPF + +// +// DPF +// + +void cdecl D3DXDebugPrintf(UINT lvl, LPCSTR szFormat, ...) +{ + static UINT uDebugLevel = (UINT) -1; + + char strA[4096]; + char strB[4096]; + + va_list ap; + va_start(ap, szFormat); + StringCchVPrintfA(strA, sizeof(strA), szFormat, ap); + strA[4095] = '\0'; + va_end(ap); + + StringCchPrintfA(strB, sizeof(strB), "Effects11: %s\r\n", strA); + + strB[4095] = '\0'; + + OutputDebugStringA(strB); +} +#else +// This is defined so warning LNK4211 is not generated (object file has no public symbols) +void cdecl D3DXDebugPrintf(UINT lvl, LPCSTR szFormat, ...) {} +#endif + + +// +// D3DXASSERT +// + +#ifdef _DEBUG + +int WINAPI D3DXDebugAssert(LPCSTR szFile, int nLine, LPCSTR szCondition) +{ + char str[512]; + + // Print message to debug console + StringCchPrintfA(str, sizeof(str), "Assertion failure! (%s %d): %s\r\n", szFile, nLine, szCondition); + str[511] = 0; + OutputDebugStringA(str); + + return 0; +} +#endif + |