Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


why value is different?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 25 June 2012 - 11:40 PM

so i have this line

float vc =dd[0].x;

then i debug to check what the value of vc is

dd[0].x ----> 65503.000

vc ----> -1.0737418e+008


why?

dd is an array of D3DXVECTOR4

Edited by lomateron, 25 June 2012 - 11:44 PM.


Sponsor:

#2 szecs   Members   -  Reputation: 2185

Like
0Likes
Like

Posted 25 June 2012 - 11:48 PM

Debugging with debugger or by printing values?

#3 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 25 June 2012 - 11:49 PM

Debugging with debugger



#4 ApochPiQ   Moderators   -  Reputation: 16413

Like
0Likes
Like

Posted 26 June 2012 - 12:01 AM

Release or Debug build?

#5 szecs   Members   -  Reputation: 2185

Like
0Likes
Like

Posted 26 June 2012 - 12:01 AM

Are you stepping the code through with breakpoints? If the breakpoint is on the line float vc =dd[0].x; then the value you see for vc will be the value before the assignment (at leas in MS Visual C++).
Place a breakpoint after that line and see the values again.

EDIT: maybe in debug build, you should see vc = 0. so if you are in debug build, my post is off, I think.

Edited by szecs, 26 June 2012 - 12:03 AM.


#6 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 26 June 2012 - 12:01 AM

its the debbuger from visual studio 2010 ultimate

#7 bglanzer   Members   -  Reputation: 459

Like
1Likes
Like

Posted 26 June 2012 - 12:06 AM

I think your not stepping the debugger through that line. Make sure your break point is set on the next instruction after float vc =dd[0].x; The debugger can reflect random values in variables that are not initialized.

You can verify with

float vc = 0.0f;
vc = dd[0].x;;

vc should be zero instead of a different number if you place the breakpoint at vc = dd[0].x;

Brendon Glanzer


#8 szecs   Members   -  Reputation: 2185

Like
0Likes
Like

Posted 26 June 2012 - 12:08 AM

Are you stepping the code through with breakpoints? If the breakpoint is on the line float vc =dd[0].x; then the value you see for vc will be the value before the assignment (at leas in MS Visual C++).
Place a breakpoint after that line and see the values again.

EDIT: maybe in debug build, you should see vc = 0. so if you are in debug build, my post is off, I think.



#9 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 26 June 2012 - 12:09 AM

oo sorry you are right i just had to press f10 again and the value was correct.
that line was to find were the value is changing because the value isn't what it must be in a pixel of 2d texture inside GPU memory so i thought i found it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS