Jump to content
  • Advertisement
zyrolasting

References on Release + Oddities

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

I've been told a couple of times about seeking out invalid/null pointers and the like, but I am obviously missing something. I can't tell you how much I wish I just... Understood this! I get the nagging feeling this is simpler than I'm making it. I adopted a method from another coder to check for references. This is the function called once the program is ready to close. This is pretty primitive, I know. I tried using sprintf, and sprintf_s for param 1 of MessageBox along with a 256 byte buffer, but all of the characters showed up as outlined squares/unknown characters. (Why is this...? If you are going to suggest a project setting change, please walk me through that and what I should watch for)
void CloseDirect3D()
{
	int RefC;
    RefC = d3ddev->Release();
	if (RefC > 0)
	{
		MessageBox(NULL, L"d3ddev", L"ERROR", MB_OK);
	}

	RefC = d3dspr->Release();
	if (RefC > 0)
	{
		MessageBox(NULL, L"d3d", L"ERROR", MB_OK);
	}
	RefC = d3d->Release();
	if (RefC > 0)
	{
		MessageBox(NULL, L"Error releasing d3d", L"ERROR", MB_OK);
	}
	return;
}


d3ddev and d3d had some extra references, and I'm trying to fight these errors as well, (I'm not sure if they are relevant) Direct3D9: (ERROR) :GetClientRect Failed ? Direct3D9: (ERROR) :GetClientRect Failed ? Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present I am ensuring that my models and sprites (in structs) are being released properly. They have the same method for destructors, and I saw no box for them. The same can be said for the mesh textures.

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!