Hi Travis,
Thanks. I'll give it a try. If given a choice I'd rather use SFML over
SDL for OpenAL support alone. However, I've been playing with the
latest SFML build for Linux here and the keyboard input is much better
than SDL. The event handling for keyboard events is much more like
what I am use to from DirectInput, and is very smooth and natural.
With SDL it only accepts a single key pressed or key released event
which means if you have to hold an arrow key down to walk, run, etc
you have to use some sort of boolean flag to tell the application that
the key is being held down or if it has been released. That's not too
cool, but is an easy enough problem to solve with a little extra
coding. With SFML though the way the event system is setup you can
test if the key is being held down and take the proper action without
having to take the extra step of writing a separate keyboard handler
to determine if the key is being held down for a certain period of
time.


Smile.



On 7/28/10, Travis Siegel <tsie...@lothlorien.nfbcal.org> wrote:
>
> On Jul 27, 2010, at 8:14 PM, Thomas Ward wrote:
>
> Hi travis,
> Hmmm...That's what I was afraid of. Back during the winter when I was
> thinking about a cross-platform engine I tried both SFML and SDL
> extensively and was able to do what you did witht the sound objects by
> using the sf::Sound::SetBuffer() function to reassign buffers. As you
> pointed out it solves the problem of reassigning a sound object to a
> new sound buffer, but it waistes a lot of memory in the process. Even
> worse this kind of creating a buffer without the ability to destroy it
> when you are done with it can lead to a major memory leak in your
> program.
>
> I just asked on the sfml forums, and I'm guessing the developer of sfml
> doesn't use english as his first language, (though he does speak it quite
> well) my first attempt met with confusion, pointing me to the sounds instead
> of their buffers.  Further clarification lead to the answer you wanted.
> Apparently, you can clear a buffer (if you want to use it later) simply by
> assigning it an empty resource.
> I.E.
> buffer = SoundBuffer();
> This will reassign the buffer to null, thereby allowing the memory to be
> used for other things.
> If you allocate the buffer using new, you could also free it (permanently)
> by using delete.
> I didn't set mine up that way in the chopper patrol port, so teh new/delete
> wouldn't work, but the reassigning buffers to empty values does seem to do
> the trick though.
> Hope this helps.
>
>
> ---
> Gamers mailing list __ Gamers@audyssey.org
> If you want to leave the list, send E-mail to
> gamers-unsubscr...@audyssey.org.
> You can make changes or update your subscription via the web, at
> http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
> All messages are archived and can be searched and read at
> http://www.mail-archive.com/gam...@audyssey.org.
> If you have any questions or concerns regarding the management of the list,
> please send E-mail to gamers-ow...@audyssey.org.
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gam...@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to