Jump to content
  • Advertisement
Sign in to follow this  
akaitora

Mesh doesn't render in release mode...

This topic is 3325 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

Hey guys. I am using DirectX 9.0c and Visual C++ 2005. I am using the "D3DXLoadMeshFromX" to load a .x 3d model. When I run my game the first time, the mesh appears to render properly. However when I exit the game mode and go back to the game menu and then go back into the game, the mesh no longer renders. This only happens when I run the game inside Visual Studio. If I run the binary directly, I don't have any problems at all. I have searched and searched for any possible memory leaks or heap corruptions but I am just not seeing any. I also know that the path from which I am loading my mesh is correct. Has anyone run into this sort of problem in the past? Thanks in advance!
MeshWidget::MeshWidget(LPDIRECT3DDEVICE9 dev, char *strFilename)
{
	char strFullFilename[50];
	char strErrorBuffer[40];
	this->dev = dev;
	this->strName = strFilename;
	this->mesh = NULL;

	this->m_iID = 0;

	this->m_iType = 2;

	tex = NULL;

	fX = fY = 1.0f;
	fZ = 0.0f;

	fScale = 1.0f;

	fRotX = fRotY = fRotZ = 0.0f;

	bAutoRotate = false;

	sprintf_s(strFullFilename,"..\\assets\\meshes\\%s\0",strFilename);
	if(!SUCCEEDED(D3DXLoadMeshFromX(strFullFilename,D3DXMESH_MANAGED,dev,NULL,NULL,NULL,&fNumOfTextures,&this->mesh)))
	{ 
		this->mesh = NULL;
		sprintf(strErrorBuffer,"Could not load mesh %s\0",strFilename);
		DataLogger::getInstance()->addEntry(strErrorBuffer,MESSAGE_TYPE_ERROR);
	}
}

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!