headers.h

来自「VC++ DEMO, used for the beginners and th」· C头文件 代码 · 共 56 行

H
56
字号
#ifndef CGE_HEADER_H
#define CGE_HEADER_H
#pragma warning (disable : 4243)
#pragma warning (disable : 4800)
#pragma warning (disable : 4786)

#include <WINDOWS.H>
#include <STDIO.H>
#include <TCHAR.H>
#include <MMSYSTEM.H>

#include <D3D8.H>
#include <D3DX8.H>
#include <DINPUT.H>


#pragma comment(lib,"D3D8.LIB")
#pragma comment(lib,"D3DX8.LIB")
#pragma comment(lib,"DINPUT8.LIB")
#pragma comment(lib,"DXGUID.LIB")
#pragma comment(lib,"WINMM.LIB")
#pragma comment(lib,"D3DXOF.LIB")


#include <MAP>
#include <DEQUE>
#include <STRING>
#include <VECTOR>
#include <ALGORITHM>


#define USING using
#define NAMESPACE namespace
#define CGE_INLINE inline


#define SAFE_RELEASE(x) if (x) { x->Release();x = 0; }
#define SAFE_DELETE(x) if (x) { delete x;x = 0; }
#define SAFE_DELETE_ARRAY(x) if(x) { delete [] x; x = 0; }
#define SAFE_FREE(x) if(x) { free(x);x = 0; }

#define CHECK_RANGE(x, min, max)  x = (x<min  ? min : x<max ? x : max);
#define BOOL_RANGE(x,min,max) (( x >= min ) && ( x <= max ) )

#define RANDOM   (((float)rand())/RAND_MAX)
#define RANDOM_FLOAT    (((float)rand()-(float)rand())/RAND_MAX)
#define RANDOM_RANGE(min,max) (RANDOM*((max)-(min))+min)

#define RANDOM_VECTOR   D3DXVECTOR3(RANDOM_FLOAT,RANDOM_FLOAT,RANDOM_FLOAT)
#define NULL_VECTOR D3DXVECTOR3(0,0,0)

#define LINEAR_INTERPOLATE(B,E,S) ((B)+((B)-(E))*(S))
#define RANDOM_LERP_RANGE(MIN,MAX,RATE) ((MIN)+((FLOAT)(rand()%(INT)(((MAX)-(MIN))*(RATE)))/(RATE)))
#define RAND_COORD(max,min)   ((float)rand()/RAND_MAX * (max) - (min))
#define SQR(x) ((x)*(x))
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?