Menu

[025cc2]: / DirectPython11 / stdafx.h  Maximize  Restore  History

Download this file

102 lines (79 with data), 2.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
/*
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 <boost/utility.hpp>
#include <boost/scoped_array.hpp>
#include <boost/python.hpp>
#include <boost/python/slice.hpp>
#include <boost/python/stl_iterator.hpp>
#include <boost/shared_ptr.hpp>
#include <windows.h>
//Direct3D.
#include <d3d11.h>
#include <d3dcompiler.h>
#include <d3dx11.h>
#include <DXErr.h>
//Effects 11 must be built manually.
#include <D3dx11effect.h>
//XNAMath
#define XM_NO_ALIGNMENT
#define _XM_NO_INTRINSICS_
#include <Xnamath.h>
//Standard library.
#include <string>
#include <vector>
#include <set>
#include <sstream>
//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<typename T> 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<typename T>
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);
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.