⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 headers.h

📁 VC++ DEMO, used for the beginners and the amour
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -