我是把书上的例子照搬上去的,之前是出现d3dx9.lib无法打开的错误,现在是这个错误。
一下是我的winmain函数:
int WINAPI WINMAIN(HINSTANCE hInstance,HINSTANCE hPreInstance,LPSTR lpCmdLine,int nCmdShow)
{
//set the new window's properties
//previously found in the MyRegisterClass function
WNDCLASSEX wc;
wc.cbSize=sizeof(WNDCLASSEX);
wc.style=CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc=(WNDPROC)WinProc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hInstance=hInstance;
wc.hIcon=NULL;
wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);
wc.lpszMenuName=NULL;
wc.lpszClassName=APPTITLE.c_str();
wc.hIconSm=NULL;
RegisterClassEx(&wc);
//create a new window
//previously found in the InitInstance function
HWND window=CreateWindow(APPTITLE.c_str(),APPTITLE.c_str(),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
SCREENW,SCREENH,
NULL,NULL,hInstance,NULL);
//was there an error creating the window?
if(window==0) return 0;
//display the window
ShowWindow(window,nCmdShow);
UpdateWindow(window);
//initialize the game
if(!Game_Init(window)) return 0;