/* Copyright (C) 2010, Heikki Salo All rights reserved. Distributed under the BSD license: http://www.opensource.org/licenses/bsd-license.php */ #pragma once #include "targetver.h" #define DPVERSIONHEXSTR "0x00000100" #define DPVERISONMAJOR 0 #define DPVERSIONMINOR 1 #define DPVERSIONMICRO 0 //Buffer and Texture buffer protocol support. #define DP_BUFFER_SUPPORT #define WIN32_LEAN_AND_MEAN //Boost #include #include #include #include #include #include #include //Direct3D. #include #include #include #include //Effects 11 must be built manually. #include //XNAMath #define XM_NO_ALIGNMENT #define _XM_NO_INTRINSICS_ #include //Standard library. #include #include #include #include //Libraries. #pragma comment(lib, "dxerr.lib") #pragma comment(lib, "dxguid.lib") #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "d3dcompiler.lib") #pragma comment(lib, "Effects11.lib") #if defined(_DEBUG) #pragma comment(lib, "d3dx11d.lib") #else #pragma comment(lib, "d3dx11.lib") #endif //PyPy test build support. *Very* experimental. #ifdef DP_PYPY inline void PySys_WriteStdout(const char* text) { } template void Py_AtExit(T arg) { } #define PySequence_ITEM PySequence_GetItem #define PyBytes_FromStringAndSize PyString_FromStringAndSize //No buffer protocol. #undef DP_BUFFER_SUPPORT #pragma comment(lib, "libpypy.lib") #endif namespace python = boost::python; //"Safe" release for COM-objects, note the reference argument. template void SafeRelease(T& comptr) { if (comptr != 0) { comptr->Release(); comptr = 0; } } void DPThrow(const char* message); void DPThrow(HRESULT); inline void TestHR(HRESULT hr) { if (FAILED(hr)) { DPThrow(hr); } }