首先是CreateWindow函数需要改动一下:
HWND hWnd = CreateWindow("MyWindowClass", "Cube Demo",
WS_EX_TOPMOST | WS_VISIBLE | WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInstance, NULL);
其次是D3DPRESENT_PARAMETERS的设置:
D3DPRESENT_PARAMETERS presParams;
ZeroMemory(&presParams,sizeof(presParams));
presParams.Windowed=FALSE; //全屏模式
presParams.SwapEffect=D3DSWAPEFFECT_DISCARD;
presParams.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
presParams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; //刷新频率
presParams.BackBufferFormat=D3DFMT_X8R8G8B8; //8位为红色,8位为绿色,8位为蓝色
presParams.BackBufferCount=1;
presParams.BackBufferWidth = 1366; //全屏屏幕宽度
presParams.BackBuff