Original Post
In short, i have this model i created, and when i draw it to the screen, my FPS goes to about 28-32, but when i load the model in the DirectX viewer, it can draw it at 58-60 FPS. Also, toymaker.info's bounding box collision demo can load it and run it at 60 FPS as well. My loop that i'm calculating the FPS of looks kinda like this:
The rendering of the model is a class function that looks like this:
I'm using Microsoft's visual c++ 2010 compiler with the June 2010 DirectX SDK. I hope i have provided enough code. I'm 99% sure it is somewhere in this. If you need more of the code i would be glad to provide it. This code is widely influenced by the directxtutorial.com guys, so if it looks familiar, thats why. Any help would be much appreciated.
d3ddevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);d3ddevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);d3ddevice->BeginScene();//Render Modeld3ddevice->EndScene();d3ddevice->Present(NULL, NULL, NULL, NULL);The rendering of the model is a class function that looks like this:
void Model::draw(){ //View D3DXMATRIX matView; D3DXMatrixIdentity(&matView); D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3(0,2,-10), &D3DXVECTOR3(0,0,0), &D3DXVECTOR3(0,1,0)); m_app->m_d3ddev->SetTransform(D3DTS_VIEW, &matView); //Transform D3DXMATRIX matScale, matRotate, matTranslate, matWorld; D3DXMatrixIdentity(&matScale); D3DXMatrixIdentity(&matRotate); D3DXMatrixIdentity(&matTranslate); D3DXMatrixIdentity(&matWorld); D3DXMatrixScaling(&matScale, 1, 1, 1); D3DXMatrixRotationYawPitchRoll(&matRotate, 0, 0, 0)); D3DXMatrixTranslation(&matTranslate, 0, 0, 0); matWorld = matScale*matRotate*matTranslate; this->m_app->m_d3ddev->SetTransform(D3DTS_WORLD, &matWorld); //Draw for(DWORD i = 0; i < this->m_numMaterials; i++){ this->m_app->m_d3ddev->SetMaterial(&this->m_material); if(this->m_texture != NULL){ this->m_app->m_d3ddev->SetTexture(0, this->m_texture); } this->m_mesh->DrawSubset(i); }}I'm using Microsoft's visual c++ 2010 compiler with the June 2010 DirectX SDK. I hope i have provided enough code. I'm 99% sure it is somewhere in this. If you need more of the code i would be glad to provide it. This code is widely influenced by the directxtutorial.com guys, so if it looks familiar, thats why. Any help would be much appreciated.