Archived

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

deadalive

Problem with nehes SDL demos

Recommended Posts

I found a big problem with all of the SDL versions of the Nehe demos.. it has Huge memory leakage/eats up a big chunk of memory when it loses focus while in fullscreen mode.. minimizing and returning to fullscreen a mere 7 times will deplete all system resources and crash my (new) pc.. The memory seems to return if you exit before that happens, but this is still very bad! All I want to do is make a fullscreen SDL window that wont do this, so I can make SDL games/demos.

Share this post


Link to post
Share on other sites
Try my window, no bugs have been reported so far.
Find the tutorial and download here.

I tried making the window lose focus a few times, it didnt seem to have a big hit on resources.

If you do find any problems, just mail me. Or post in the comments.

Lukerd.

"To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites
Hmm, well that is slightly better.. still leaks a little bit each time. I dont know but I posed the problem to the SDL mailing list people and got flamed for it. Apparently they all know what to do, it has something to do with the SDL hardware surfaces being "trashed" when the window loses focus, and you are supposed to somehow free the surface and recreate it. Everything Ive tried makes my monitor make funny noises and still leaks the memory.. thanks for the response though, it did help a little bit ;D
Only leaks 1 or 2% system resources as opposed to 4-6% like Ive been doing.. Im trying to get it down to 0% though, so I can do something somewhat professional..

Share this post


Link to post
Share on other sites
When the window is switched from fullscreen to windowed and back. The surface IS freed and recreated. I cant find where the leak is. I''ll keep looking.

"To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites
OK well let me know if you find anything, Im talking to some other people to try and figure it out too.. I wonder if its Windows ME? I should install 98 or another OS and see if it still happens. The code looks good, there really shouldnt be any leaking like this occurring.. Im sure alot of people dont use windows ME at all so maybe thats why this is a rare problem, hasnt really been tested? I love SDL and I wrote a ton of code that _needs_ it, like my sound engine, video playback, etc.. so I hope I/we can figure this out! A simple window should be easier than all that you would think I thought it was all set until I went back to tweak my basecode, and found it leaking memory.. cya!
-DA

Share this post


Link to post
Share on other sites
Hi Again,

I''ve checked, double checked, and triple checked the code. Ive also searched google till my eyes stopped focusing, and I still cant work it out.

Maybe it is an ME thing, I havent really noticed it on Win2k.

Anyway I''ll keep searching and I''ll let you know if I find anything.

Lukerd.

"To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites
Maybe it is just an ME thing.. I didnt notice it with windows 98 or XP.. hmm, But if it is ME only, wouldnt be acceptable to release a commercial game or app that will eventually deplete their system resources if they ALT+Tab too much, would it? Unless I can make it so they cant go to fullscreen if they have ME, or maybe tell them beforehand ME is not a supported OS? Id like to actually figure out whats causing it, but it seems that you, me, and everyone using SDL who Ive talked to is completely baffled by this.. I swear to god Im not making it up, I crashed my PC more than a few times trying to debug this..! ah well, keep in touch, Ill let you know if I figure it out..
-DA

Share this post


Link to post
Share on other sites