|
我想用索引画一个7×7的棋盘格子,但VS输出的:
Direct3D9: (ERROR) :Stream 0 does not have required number of vertices
Gobang.exe 中的 0x75729617 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0024f914 处的 long。
Direct3D9: (ERROR) rawIndexedPrimitive failed.
请问这是怎么回事?
该什么解决?
谢谢。
- void Render()
- {
- if( moveFlag)
- {
- d3d::SetMoveWorldMatrix ( pd3dDevice);
- d3d::SetMoveViewMatrix ( pd3dDevice);
- }
- else
- {
- d3d::SetWorldMatrix( pd3dDevice);
- d3d::SetBirdViewMatrix( pd3dDevice);
- }
- d3d::SetProjectionMatrix( width, height, pd3dDevice);
- pd3dDevice->Clear ( 0, 0, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
- if( SUCCEEDED( pd3dDevice->BeginScene ()))
- {
- //pd3dDevice->SetStreamSource ( 0, pVB, 0, sizeof( CUSTOMVERTEX));
- //pd3dDevice->SetFVF ( D3DFVF_CUSTOMVERTEX);
- //pd3dDevice->SetIndices ( pIB);
- //pd3dDevice->DrawIndexedPrimitive ( D3DPT_TRIANGLELIST, 0, 0, 8, 0, 12);
- pd3dDevice->SetStreamSource ( 0, bVB, 0, sizeof( CUSTOMVERTEX));
- pd3dDevice->SetFVF ( D3DFVF_CUSTOMVERTEX);
- pd3dDevice->SetIndices ( bIB);
- pd3dDevice->DrawIndexedPrimitive ( D3DPT_TRIANGLELIST, 0, 0, 49, 0, 3);
- pd3dDevice->EndScene ();
- }
- pd3dDevice->Present ( 0,0,0,0);
- }
复制代码
|
|