Jump to content
  • Advertisement
Sign in to follow this  
Sfpiano

Running DX in debug without software emulation

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

Given the following code:
std::vector<cube> cubes;
...
1: int t = cubes.size();
2: for(i=0; i<cubes.size(); i++)
3:	cubes.Render();
I've set a breakpoint on lines 2 and 3; when it hits line 2, the value of 't' is 64. When it hits line 3, the value of 't' changes to -893424240 or something like that, but it shouldn't be changing at all. [Edited by - Sfpiano on May 16, 2005 7:39:07 PM]

Share this post


Link to post
Share on other sites
Advertisement
Try this and see what the value of t is reported on the new breakpoint


std::vector<cube> cubes;
...
// Make sure cubes does contain elements

int t = cubes.size();
for( i=0; i<cubes.size(); i++ )
{
cubes.Render();
t=t; // Put a breakpoint here, as you can see t=t does nothing really, but it will allow for a breakpoint to be placed
//, if you just put t; it will not break on the line
}





I think that it's just a scope issue, since t is not being used inside that loop, then it is not in 'scope', this has some wacky value reported by the debugger.

Share this post


Link to post
Share on other sites
I tried:

int t = cubes.size();
for( i=0; i<cubes.size(); i++ )
{
t=t; //<--- Breakpoint here
cubes.Render();
t=t;
}


and t was equal to some random negative value; worse so was i. This is all on the first iteration through the loop.

Share this post


Link to post
Share on other sites
It's caused by stack corruption. Check that you're not overwriting bounds of your array, or writing into the addres of a pointer instead of the pointer value itself and other things like that.
First, try doing a rebuild all, incase the compiler is screwing up, and if the problem still exists, you can try tracing into the STL code if you're feeling brave...
Also, try commenting out parts of your Render() method until the problem goes away, then you'll be able to tell what part of Render() is causing the problem.

Share this post


Link to post
Share on other sites
Ok, I cleared everything out and it works no, but I have a quick question: is there a way to run DX in debug mode using hardware rendering instead of software emulation? I have allow hardware acceleration checked, but it still runs it in software mode at 1-ish FPS.

Share this post


Link to post
Share on other sites
The only way DX is likely to use software rendering is if you've asked for it in the code somewhere in initialisation, for example by choosing the reference device (although my DX knowledge is outdated).

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!