Jump to content
  • Advertisement
Sign in to follow this  
Trillian

A problem with card caps

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

Hello! I have started a game project and it is going well. However, when I try to send it to the game's artist, he cannot run it. The direct3D device cannot be created on his computer. For a reason I don't remember, I tought the problem was the PresentationInterval, so I wrote the following code :
D3DCAPS9 cardcaps;
D3DManager.GetCaps(cardcaps);
	
std::string supportedPresentationIntervals = "This card supports :\n";
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_DEFAULT)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_DEFAULT\n";
}
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_ONE\n";
}
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_TWO\n";
}
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_THREE)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_THREE\n";
}
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_FOUR\n";
}
if(cardcaps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
{
	supportedPresentationIntervals += "D3DPRESENT_INTERVAL_IMMEDIATE\n";
}

BGL_LOG_USELESSINFO(supportedPresentationIntervals.c_str());


Now, when he runs it, the created log file contains:
This card supports :
D3DPRESENT_INTERVAL_FOUR
And if I set the presentation interval to this value it still does not work at his house (it might be another present_parameter that causes the problem...) The weird thing is that if I run this at home, where i use D3DPRESENT_INTERVAL_IMMEDIATE, my log file contains:
This card supports :
that's all! But the app works... strange isn't it? Is my cardcap-checking code right?

Share this post


Link to post
Share on other sites
Advertisement
You can't check for default or immediate as those values are 0. Depending on your logging method you might benefit from \r\n. It's possible the values are logged, but you're just not seeing it.

\n is a CR (carriage return) which just moves back to column 0.
\r is a LF (line feed) which advances to the next line.

In ascii mode, a \n may be converted or \r\n. When using, for example, "type" in a command prompt, it obeys the correct meanings of \r and \n in the file. A file with just \n may print ONE, then print TWO over top of that, then THREE over top of that. I'd expect with FOUR, you'd see FOURE, unless THREE isn't actually supported.

You can always try the D3DCAPS viewer to see what's being reported in the caps to ensure your app isn't faulty.

I've never use std::string, but I'd expect += to work... but you never know. Try stepping through the code.

Share this post


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

  • 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!