[SDL] Mouse Input + Delay problem
Mason Wheeler
masonwheeler at yahoo.com
Mon Apr 7 10:55:47 PDT 2008
The C language family isn't my strong suit, so this may be completely wrong, but it looks to me like you're declaring variables within the body of your while loop. If so, it's no surprise that you're leaking memory. Try declaring all variables at the very top of the function, before any actual lines of code, so they only get allocated once. See if that fixes it.
----- Original Message ----
From: Ankush Thakur <ankush.gamedev at gmail.com>
To: A list for developers using the SDL library. (includes SDL-announce) <sdl at lists.libsdl.org>
Sent: Monday, April 7, 2008 10:33:42 AM
Subject: Re: [SDL] Mouse Input + Delay problem
I'm attaching my main.cpp source file with this mail.
The trouble is that I have to handle a game variable called gameRunning.
So, the structure now is...
main()
while gameRunning
while frame time not elasped...
draw
check for clicks
........... etc etc.
The problem is that the game in eating increasing amounts of RAM per second. I guess the reason is the two while loops or maybe I'm wrong.
My programming is not so good, so please feel free to scold me for any concept/design errors in my program.
Any questions related to code, please ask.
Please help me out with this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080407/06d15672/attachment.htm
More information about the SDL
mailing list