Join Date: Dec 2011
Posts: 97
User-Rating:
|
Meine Code:
TEXT Code: IDirect3DPixelShader9 *Yellow = NULL;
TEXT Code: HRESULT GenerateShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf) { char szShader[ 256 ]; ID3DXBuffer *pShaderBuf = NULL; if (setzBuf){ sprintf_s( szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0\nmov oDepth, c0.x", r, g, b, 1.0f ); } else{ sprintf_s( szShader, "ps_3_0\ndef c0, %f, %f, %f, %f\nmov oC0,c0", r, g, b, 1.0f ); } D3DXAssembleShader(szShader, (strlen(szShader)+1), NULL, NULL, 0, &pShaderBuf, NULL ); if(FAILED(pD3Ddev->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)) )return E_FAIL; return S_OK; }
TEXT Code: GenerateShader(pDevice, &Yellow, 1.0, 1.0f, 0.0f, false);
TEXT Code: HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount){ if(menu.ChamState == true){ if(Terrorist){ pDevice->SetRenderState(D3DRS_ZENABLE, false); pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); pDevice->SetPixelShader(Yellow); pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); pDevice->SetRenderState(D3DRS_ZENABLE, true); pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); pDevice->SetPixelShader(Red); } if(CounterTerrorist){ pDevice->SetRenderState(D3DRS_ZENABLE, false); pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); pDevice->SetPixelShader(Green); pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); pDevice->SetRenderState(D3DRS_ZENABLE, true); pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); pDevice->SetPixelShader(Blue); } } return pDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount); }
Jetzt sollte es Funktionieren (also mein dreck)
... schick mal bitte n Screen Shot von deinen "BUGS"
|