Mesh doesn't render in release mode...

Started by
-1 comments, last by akaitora 14 years, 11 months ago
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);
	}
}

xdpixel.com - Practical Computer Graphics

This topic is closed to new replies.

Advertisement