๐Ÿ“ฆ jkjkil4 / SimpleGraphicsEngine

๐Ÿ“„ utility_dx.h ยท 39 lines
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#pragma once

#include "utility.h"

#include <d3d9.h>
#pragma comment(lib,"d3d9.lib")
#include <d3dx9.h>
#pragma comment(lib,"d3dx9.lib")

namespace ge {
	typedef LPDIRECT3DTEXTURE9 LPTexture;
	typedef LPDIRECT3DSURFACE9 LPSurface;
	typedef LPD3DXSPRITE LPSprite;
	typedef LPD3DXFONT LPFont;
	typedef LPDIRECT3DVERTEXSHADER9 LPVertexShader;
	typedef LPDIRECT3DPIXELSHADER9 LPPixelShader;
	typedef LPD3DXCONSTANTTABLE LPConstantTable;

	typedef LPDIRECT3DVERTEXBUFFER9 LPVertexBuffer;
	typedef LPDIRECT3DINDEXBUFFER9 LPIndexBuffer;

	typedef LPDIRECT3D9 LPDirectx;
	typedef LPDIRECT3DDEVICE9 LPDevice;

	typedef D3DXIMAGE_INFO ImageInfo;

	template<typename T>inline void SafeRelease(T*& t) {
		if (t) {
			t->Release();
			t = nullptr;
		}
	}

	struct Vertex
	{
		float x, y, z, rhw;
		DWORD color;
	};
}