Sign in to follow this  

Running DX in debug without software emulation

This topic is 4594 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[i].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
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[i].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[i].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

This topic is 4594 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this