Join Date: Sep 2013
Posts: 5
User-Rating:
|
Moin Leute,
hat mal jemand "echte" Polygone in die CoD2-Welt eingefügt? Ich habe cuBot und Tatnium in Visual Studio kombiniert, sodass ich jetzt D3D-Funktionen hooken kann, aber wenn ich DirectX Tutorials folge, kann ich keine Polygone zeichen. Das Fenster bleibt dann einfach schwarz. Diesen Code verwende ich bisher:
TEXT Code: HRESULT APIENTRY hkIDirect3DDevice9::EndScene() { #if 1 struct CUSTOMVERTEX { FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag DWORD color; // from the D3DFVF_DIFFUSE flag }; static int first = 1; static LPDIRECT3DVERTEXBUFFER9 v_buffer = NULL; printf("HRESULT APIENTRY hkIDirect3DDevice9::EndScene(%d)\n", first); if (first) { first = 0; #define CUSTOMFVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE) CUSTOMVERTEX vertices[] = { { 1551.0f+320, 2663.0f+ 50, 415.0f, 1.0f, D3DCOLOR_XRGB(0, 0, 255), }, { 1551.0f+520, 2663.0f+400, 415.0f, 1.0f, D3DCOLOR_XRGB(0, 255, 0), }, { 1551.0f+120, 2663.0f+400, 415.0f, 1.0f, D3DCOLOR_XRGB(255, 0, 0), }, }; m_pD3Ddev->CreateVertexBuffer(3*sizeof(struct CUSTOMVERTEX), 0, CUSTOMFVF, D3DPOOL_MANAGED, &v_buffer, NULL); VOID* pVoid; // the void pointer v_buffer->Lock(0, 0, (void**)&pVoid, 0); memcpy(pVoid, vertices, sizeof(vertices)); v_buffer->Unlock(); } LPDIRECT3DSTATEBLOCK9 pStateBlock = NULL; m_pD3Ddev->CreateStateBlock( D3DSBT_ALL, &pStateBlock ); pStateBlock->Capture(); //m_pD3Ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); //m_pD3Ddev->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);//<- //m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); //m_pD3Ddev->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); //m_pD3Ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR); //m_pD3Ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR); //D3DVECTOR vEyePt = {0.0f, 0.0f, -10.0f }; //D3DVECTOR vLookatPt = {0.0f, 0.0f, 0.0f }; //D3DVECTOR vUpVec = {0.0f, 1.0f, 0.0f }; //D3DMATRIX matWorld, matView, matProj; // // //D3DUtil_SetIdentityMatrix( matWorld ); //m_pD3Ddev->SetFVF(CUSTOMFVF); // select which vertex format we are using m_pD3Ddev->SetStreamSource(0, v_buffer, 0, sizeof(struct CUSTOMVERTEX)); // select the vertex buffer to display m_pD3Ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1); // copy the vertex buffer to the back buffer pStateBlock->Apply(); pStateBlock->Release(); #endif return m_pD3Ddev->EndScene(); }
Ich hoffe, hier gibt's noch ein paar fähige Leute.
Das ganze soll eine CoD2-Erweiterung werden, mit der bullet physics engine.
Viele Grüße, kung foo man
|