Archived

This topic is now archived and is closed to further replies.

shakazed

Whuds wrong with this rendering code?

Recommended Posts

...
    

void cGraphics::RenderBox(void)
{
	D3DXMATRIX matView;
	D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3(0.0f,0.0f,-50.0f), //Camera position

		&D3DXVECTOR3(0.0f,0.0f,0.0f), //Look at position

		&D3DXVECTOR3(0.0f,1.0f,0.0f)); //Up direction


	m_iD3DDevice8->SetTransform(D3DTS_VIEW, &matView);

	D3DXMATRIX matProj;
	D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f);
	m_iD3DDevice8->SetTransform(D3DTS_PROJECTION, &matProj);


	m_iD3DDevice8->SetStreamSource(0, m_iD3DBoxVertBuf, sizeof(CUSTOMVERTEX));
	m_iD3DDevice8->SetVertexShader(MY_FVF);
	m_iD3DDevice8->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0,1);
}


    
I get an access violation when running it. Any help appreciated.
Bad Monkey Productions [edited by - shakazed on August 18, 2002 7:03:04 AM]

Share this post


Link to post
Share on other sites