问个纹理坐标的问题...
RECT rcSrc = {100,90,179,175};CustomVertex objData[] ={ { float(x), float(y), 0, 1, color, float(rcSrc.left/width), float(rcSrc.top/height) }, { float(rcSrc.right-rcSrc.left+x), float(y), 0, 1, color, float(rcSrc.right/width), float(rcSrc.top/height) }, { float(rcSrc.right-rcSrc.left+x), float(rcSrc.bottom-rcSrc.top+y), 0, 1, color, float(rcSrc.right/width), float(rcSrc.bottom/height) }, { float(rcSrc.right-rcSrc.left+x), float(rcSrc.bottom-rcSrc.top+y), 0, 1, color, float(rcSrc.right/width), float(rcSrc.bottom/height) }, { float(x), float(rcSrc.bottom-rcSrc.top+y), 0, 1, color, float(rcSrc.left/width), float(rcSrc.bottom/height) }, { float(x), float(y), 0, 1, color, float(rcSrc.left/width), float(rcSrc.top/height) }};for (int i=0; i<6; i++){ objData[i].tu += float(0.5/width); objData[i].tv += float(0.5/height);}// ...
SetRect( &rc, 0, 0, IC_WINDOWS_WIDTH, IC_WINDOWS_HEIGHT ); AdjustWindowRect( &rc,WS_OVERLAPPEDWINDOW&(~WS_MAXIMIZEBOX)&(~WS_SIZEBOX),FALSE); hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW&(~WS_MAXIMIZEBOX)&(~WS_SIZEBOX),0,0,(rc.right - rc.left),(rc.bottom-rc.top), NULL, NULL, hInstance, NULL);
[解决办法]
QQ已经加了 , 我的运行结果就如上图