Windows 8 SDK重命名了所有标题,我不知道现在要包括什么?

Bra*_*lov 6 sdk winapi directx-11 windows-8

在我更新到新SDK之前,这些是我的标题:

#pragma once

#ifndef _EXTERNAL_DEPENDENCIES_H_
#define _EXTERNAL_DEPENDENCIES_H_

#if defined(DEBUG) || defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif

#include <windows.h>
#include <time.h>
#include <mmsystem.h>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <assert.h>
#include <fcntl.h>
#include <pdh.h>
#include <stack>
#include <map>
#include <memory>
#include <random>
#include <xaudio2.h>
#include <x3daudio.h>
#include <xaudio2fx.h>
#include <ogg\ogg.h>
#include <ogg\os_types.h>
#include <vorbis\codec.h>
#include <vorbis\vorbisenc.h>
#include <vorbis\vorbisfile.h>

#include "d3dx11Effect.h"
#include <d3dx11.h>
#include <xnamath.h>
#include <dxerr.h>
#include <dinput.h>
#include <d3dcommon.h>
#include <dxgi.h>
#include <d3d11.h>
#include <d3dcompiler.h>
#include <d3dx10math.h>
#include <d3dx11async.h>
#include <D3DX11tex.h>
#include <gdiplus.h>

#pragma comment (lib, "gdiplus.lib")
#pragma comment (lib, "winmm.lib")
#pragma comment (lib, "dxguid.lib")  
#pragma comment (lib, "d3dx9d.lib")  
#pragma comment (lib, "d3dx10d.lib")  
#pragma comment (lib, "d3d11.lib")  
#pragma comment (lib, "d3dx11.lib")        
#pragma comment (lib, "dxgi.lib")
#pragma comment (lib, "dxgi.lib")
#pragma comment (lib, "dxerr.lib")
#pragma comment (lib, "d3dx10.lib")
#pragma comment (lib, "wsock32.lib")
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")
#pragma comment (lib, "pdh.lib")
#pragma comment (lib, "comctl32.lib")
#pragma comment (lib, "xaudio2.lib")
#pragma comment (lib, "x3daudio.lib")
#pragma comment (lib, "libogg.lib")
#pragma comment (lib, "libogg_static.lib")
#pragma comment (lib, "libvorbis.lib")
#pragma comment (lib, "libvorbisfile.lib")

#pragma warning (disable : 4482)

#endif
Run Code Online (Sandbox Code Playgroud)

其中有一半在新SDK中丢失了......

大多数核心DirectX标题都被重命名了,我解决了这个问题,但是其中有一半是缺失的,比如Dxerr.h和d3dx11async.h甚至是d3dx10math.h/xnamath.h(哦,当我包含DirectXMath.h时它仍然说XMFLOAT3未定义).我现在不知道该怎么做,它是否在任何地方都说如何从2010年6月的DirectX SDK迁移到Windows SDK 8.0?

Lou*_* G. 8

DirectXMath.h中的XMFLOAT3位于命名空间DirectX中.

尝试在头文件中添加以下内容:

using namespace DirectX;
Run Code Online (Sandbox Code Playgroud)

您也可以包括<xnamath.h>而不是直接包括<DirectXMath.h><D3DX10Math.h>


Jam*_*mes 0

grep通过您使用的函数的新标头(现在缺少的标头)。否则,函数的 MSDN 文档可能会告诉您需要什么头文件。