Archived

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

Whuds wrong with this rendering code?

This topic is 5597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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