Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


I have absolutely no idea

This topic is 5987 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 really hate asking this type of questions in gamedev forum but trust me, i''m running outta options here Currently i''m working on a Game Engine using OpenGL and everything was goin just fine until yesterday when i decided to make some of the 3D math functions INLINE hoping that might give me some speed boost. Just as an information, i''m doing frustum culling in my engine and also have a cool particles engine. As soon as i made my 3D functions ( vector matrix... blah blah ) inline and compiled the project in RELEASE mode, all my particles disappeared from the scene. But magically they all reappeared when i compiled the project in DEBUG mode. The particles also reappears if i turn off the Frustum culling which show there''s something wrong in the Frustum culling functions. Now the question is WHERE AND POSSIBLY HOW ????? If there really is an error then why the hell my particles behave nicely in DEBUG mode. The most interesting thing is; this problem arised as soon as i made my math function s inline. The engine was woriking perfectly both in RELEASE and DEBUG mode before i made them inline. Later, i decided to revert back. I undid all the changes and copied the functions back to the "glmath.cpp" and to their respective positions, thus stopping them from being inline anymore. BUT THE DAMN PROBLEM PREVAILS.... NOW WHAT WIERDO IS GOING ON ? Usually when we do dynamic memory stuffs ( using malloc,free.. blah blah ) this type of problem might arise where the program runs perfectly in DEBUG mode but crashes in RELEASE mode. But , swear upon God, i didn''t do any dynamic memory in "glmath.cpp" ( why would I ever bother to ). Plus, my program doesn''t crash: the particles simply fails the Frustum culling test... WHAT CRAP IS GOIN ON ?

Share this post

Link to post
Share on other sites
The symtoms you are describing lead me to believe you have an initialization problem. Generally, when I see different behavior in debug vs. release, it is because something isn''t initialized. Debug mode generally zeroes out all of your variables and nulls your pointers.

From what you have said, off the top of my head I would see what your particle positions are. If they initialize to some garbage value, then they will be out in space somewhere. I would put a watch on your particle positions to see if this is the case.

If you do have an initialization problem, check all of your constructors and then step through your code to see what is going on.

Share this post

Link to post
Share on other sites

I''m thinking one of two things. One is that you have an

#ifdef DEBUG

somewhere that you don''t mean to. The other is a compiler bug - they do exist. What level is your optimization set to? I have often found problems with VC++ 6.0 (standard edition) with optimization on full.

My logic here is simply that, assuming that the first case in not the problem, the code being compiled by the compiler should be the same. This indicates a difference in the DEBUG compilation and the RELEASE compilation. To me, that implies something that the compiler is at fault for.

Can you download gcc and try compiling it with that? Do you have a friend who has a different compiler?

Good luck - these things are frustrating!


Share this post

Link to post
Share on other sites
I guess it''s
a) initialization problem
b) a remaining problem from inlining the functions, sometimes VC++ doesn''t rebuild the object files correctly, did you try Rebuild All?

Share this post

Link to post
Share on other sites

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