• Advertisement

Archived

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

debug && realese mode

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

Hi, I have a strange problem with some open GL/ visual 6 code I '' m just drawing a quad with a texture , I works fine in debug mode but when I switched to realese , the quad became invisible Is anybody have any idea about how to fix that ?

Share this post


Link to post
Share on other sites
Advertisement
Ok


you can download it from

http://perso.wanadoo.fr/venomelektro/3mot_26.zip

No executable are included but If you try to compile it ,

you will see that in debug mode the exit quad if fine rendered in level 1 and 2

and in realese mode , when you jump from level 1 to 2 , there is a bug with the exit rendering

Thanx in advance .

Share this post


Link to post
Share on other sites
Check that your linker options are the same for both debug and release projects in MSVC.

Share this post


Link to post
Share on other sites
When I compile my program in release mode, I got the follow warning...

LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF

How can I solve this problem? Thanks you.

Share this post


Link to post
Share on other sites
LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF

you don''t need to worry about that.


the simple answer to your question is that you have screwed up somewhere.


the more complex answer is that you most likly have a variable somewhere you are using that you havn''t defined before you use it. depending on the OS, in a release build, all new variable memory will either be zero''d, or simply random noise.. In a debug build, I''m not too sure, but I believe that all bits are set alternatly (or a strange pattern to this effect)
what this will mean is that, say, you have a bool called ''drawQuad''
if you don''t set it, in release it may be set to 0 (false) whereas in debug it could be set to something odd like 128.. this would have a different result when running your app.

This is also a common problem when using inheritance, and replacing an init function.. I do this a bit, eg, a while ago, in my d3d renderer, I forgot to set a boolean called ''multiTexturingSupported''... in debug everything was fine... in release, needless to say, it fell back to multi-pass (which is a disaster when you need specific texture unit blend modes like Dot3) and I couldn''t for the life of me work out why...

| - Project-X - my mega project.. big things comming soon - | - adDeath - an ad blocker I made - | - email me - |

Share this post


Link to post
Share on other sites
Thanks RipTorn. Do u know any method that can find out which variable I haven''t define well before use?

Share this post


Link to post
Share on other sites
yup. trial and error
either that or step through the code.
possibly turing up the compiler warning level, but thats unlikly.

| - Project-X - my mega project.. big things comming soon - | - adDeath - an ad blocker I made - | - email me - |

Share this post


Link to post
Share on other sites
Ok,


I know now that something bad happen this the memmory in the realese mode but I didn''t succeed to fix that


All the variables I use in my Render_Exit function seems to be ok : good texture pointer , good sector3 coordianates


And I dont understand why It happens only from level 1 to level 2


Share this post


Link to post
Share on other sites
quote:
Original post by xiros
it looked exactly the same for me in both release and debug.




?

Did you mean all is ok in both cases or wrong in both cases.?

Share this post


Link to post
Share on other sites
Ok,


I found that the memory is not properly cleared between level 1 and 2

If I put level 2 exit at same place that level 1 exit , I dont have this problem


void CRoom::New_Level( int Level ) {

delete [] sector1.quad;
delete [] sector2.quad;
delete [] sector3.quad;
delete [] obj.quad;


switch (Level) {


case 1:

sector1.quad = new QUAD[400];
sector1.numquads = 400;

sector2.quad = new QUAD[850];
sector2.numquads = 850;

obj.quad = new QUAD[14];
obj.numquads = 14;

sector3.quad = new QUAD[1];
sector3.numquads = 1;

s2ind = 0;
s3 = 0;


break;

case 2:

sector1.quad = new QUAD[400];
sector1.numquads = 400;

sector2.quad = new QUAD[850];
sector2.numquads = 700;

obj.quad = new QUAD[14];
obj.numquads = 14;

sector3.quad = new QUAD[1];
sector3.numquads = 1;

s2ind = 0;
s3 = 0;

break;

default:

break;

}

}



Is someting wrong with this ?

Share this post


Link to post
Share on other sites
What about this line?

sector2.quad = new QUAD[850];
sector2.numquads = 700;


why numquads = 700 instead of 850?


Also, you might check the location of your .exe file with respect with Debug one. Try executing them in the main directory instead of Debug/Release directories and test both Debug and Release .exe files.


" Do we need us? "


Ionware Productions - Games and Game Tools Development

Share this post


Link to post
Share on other sites
quote:
Original post by venomelektro
Did you mean all is ok in both cases or wrong in both cases.?


It ran very well both times, except the sky changed after the camera finished moving at the begining. It sort of changed to an almost pure orange instantly when the cam stopped. All the textures were visible, but I did get the same warning as Candy for release but not in debug.

Share this post


Link to post
Share on other sites
quote:
Original post by HellRiZZer
What about this line?

sector2.quad = new QUAD[850];
sector2.numquads = 700;


why numquads = 700 instead of 850?





Yes it was just a little mistake,


sector2.quad = new QUAD[850];
sector2.numquads = 850;

give the same result



Share this post


Link to post
Share on other sites

  • Advertisement