   DrawPrimitive Fail
  Can anyone tell me why IDirect3DDevice9::DrawPrimitive would return D3DERR_INVALIDCALL? Doing basic steps to draw a pyramid, Set my shader attributes, set my vertex declaration, set my stream source, draw..Thanks   
  It's a fairly generic error that is returned if DrawPrimitive fails.  Could be any one of 40 billion things causing it, and it's impossible to know without seeing some code.   ;StageStatic*pStatic = (StageStatic*)&node;RenderContext*pContext = pStatic->GetRenderContext();D3DXMATRIX Translation;D3DXMatrixIdentity(&Translation);D3DXMatrixTranslation( &Translation, 0.0f, 0.0f, 5.0f );pContext->SetWVP( CCamera::GetInstance()->GetViewMatrix() *CCamera::GetInstance()->GetProjectionMatrix() );pContext->GetShaderEffect()->CommitChanges();IDirect3DDevice9* pDevice = Renderer::GetActiveDevice();pDevice->SetVertexDeclaration( VertDecl::Color/*pStatic->GetMesh()->GetVertexDecl()*/ );pDevice->SetStreamSource( 0,pStatic->GetMesh()->GetGeometry()->GetVertexBuffer(),0, pStatic->GetMesh()->GetGeometry()->GetVertexSizeOf() );HRESULT hr = S_OK;if ( FAILED( hr = pDevice->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 4 ) ) ){// D3DERR_INVALIDCALLreturn;}This function would get called by a Context Function. Witch runs through the shader loop. Let me know if you want to take a look at the context function.Also the draw call is not normally hardcoded, I was just trying to debug it, But it also gives you a better idea of whats going on.   ;  Still difficult to say; your code is - as you said - fairly standard.  The most likely cause is that your vertex buffer doesn't have 12 vertexes in it.  You may also have a mismatch between your vertex format in the buffer (if you created an FVF buffer) and your vertex declaration.  Or your vertex declaration size and the stride param to SetStreamSource.Have you tried running with the debug runtime?   ;  Yeah, Im doing a complete shader approach, so Im not using the fixed function pipeline. But, diden't think to look at the stride sizes or anything. Ill take a look, Thank you for the reply.No I haven't tried the debug runtime, I usually have problems with it so I never even considered it, Ill see if it will work.   ;  Direct3D9: (WARN) :SetVertexDeclaration: NULL declaration pointerDirect3D9: (ERROR) :Vertex shader declaration is not setThanks for the tips. ;-)   ;  Hey sorry to bother you again, I have a few standard Vertex Declarations and after they get Initialized they have a valid address, but anywhere outside my "Initilize" function it returns NULL. They are all static.namespace VertDecl{static IDirect3DVertexDeclaration9* Basic;static IDirect3DVertexDeclaration9* Lit;static IDirect3DVertexDeclaration9* LitTex;static IDirect3DVertexDeclaration9* Color;static IDirect3DVertexDeclaration9* LitColor;}