Archived

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

DrKiRR

PL3D 0.3.0 bugs (???)

Recommended Posts

Hi everyone. I''ve been building an app (WinMe, VC++ 6.0) using PL3D 0.3.0 and noticed several strange er... features. Namely: 1. Debug version of my app + debug static pl3d = OK. Release version of my app + release static pl3d = hangs when trying to quit (via ESC/Alt+F4). Had to trap QUIT event and call exit () (( Release version of my app + debug static pl3d = OK 2. Seems unable to switch color depth (resolution only). My app tries to open 32 bpp window (guess bpp is ignored in window mode). When my desktop color depth = 16bpp, switching to full screen (via F12) still gives 16bpp full screen mode. When desktop depth is 32bpp all is ok. I don''t blame anyone, and please, don''t kick me too hard if i''m wrong after all (i don''t claim to have the ultimate knowledge, you know ) Regards, Alexei KiREEV aka Dr. KiRR My stuff is at http://www.geocities.com/drkirr

Share this post


Link to post
Share on other sites
Hard to tell. Make sure you set all teh fields in the window mode (bpp should work in winME). Be careful about depth & stencil stuff.

Generally I go for

bpp = 32
depth=24
stencil = 8

What video card do you have?

The crashes you experience could be anywhere - but there is a 50/50 chance it is in your code
Try doing it in pure debug mode with USE_MMGR defined (see the examples for how to use the memory manager). Also define STRESS_TEST in the project settings and see the two log files generated. This should help you track memory leaks and overwrites which cause crashes.

Hope this helps - BTW your sword gif stopped working again

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites
Ok, Brett, sure will try it... (i mean, memory manager).
Although, i guess, when i use pl3d debug it (mmgr) works
anyway - as debug version of pl3d uses it. I always get
memleaks.log after a run of debug app+debug pl3d. Mmgr
says all ok now - and before i did delete some stuff
in destructor it was yelling on me (hence if does keep track
of my app memory, not just pl3d memory).
As for the sword gif - i donno what else to do with that geocities. I''ve had ALL kinds of problems with them - corrupted
uploads, links sometimes work, sometimes not.. Their tech
support told me they don''t know what causes the problem...

Share this post


Link to post
Share on other sites
Another thing - tried mode switching on WinME (S3 video card -
software only OGL - Sheesh!). Doesn''t seem to work . Any hints?

Share this post


Link to post
Share on other sites
Hi there,

I might try downloading the model and putting it on my site for you Actually I think you sent me a couple more a while back - I''ll post those too. Thanks for that!

Mode switching - I think I know what''s wrong If you start in window mode in 16bpp, then the structure adjusts itself to that and fullscreen will just toggle. You''ll find there is a warning in the create that says it could set the bpp in window mode so it is reverting to the other I think.
I don''t know which is the best solution to this - let me think about it.

Make sure you define USE_MMGR in your project settings and the STRESS_TEST one too. You might even want to rebuild PortaLib with STRESS_TEST defined so you get more debugging. It''s slower but it''ll make sure you don''t scrog any memory

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites
Well, waht do you know!
MMGR really does wonders after all! (especially when pl3d
is built with STRESS_TEST)
That turned out to be a bug in my understanding of pl3d -
i failed to notice that object - model relations use
COM-like reference counter and that deletion of the last
object AUTOMATICALLY deletes the model.
I''ve been simply deleting the model, then the object. Simple.
So, here''s the lesson, folks - try cleaning your code before
claiming it''s somebody other''s mistake, and, use STRESS_TEST!
Silly me...

Share this post


Link to post
Share on other sites


That''s Paul Nettle''s memory manager from flipCode''s Ask Midnight - its an awesome piece of work.

That probably is my fault though - I should tell people when I make a major change to the way things work Do you agree with the strategy though?

I''m about to make a new post - "Volunteers (minimal work)" - can you please let me know if you''re able to help out? Thanks.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites
About strategy - yes, i do agree that is good.
BTW, why not use

if (ptr)
{
delete ptr;
ptr = NULL;
}
else
throw new Exception ("Tried to delete a NULL pointer");

instead of just "delete ptr;"?

Share this post


Link to post
Share on other sites
1) because it is a destructor, no need to set ptr = null
2) I''m very consistent with pointers - if they are null it is because they weren''t allocated. I use this to determine if it needs to be freed.

Hope that makes sense!

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL

Share this post


Link to post
Share on other sites