Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: How can I make sounds in my Perl game scripts?

by SpanishInquisition (Pilgrim)
on Oct 08, 2004 at 14:50 UTC ( [id://397658]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I make sounds in my Perl game scripts?
in thread How can I make sounds in my Perl game scripts?

I try to report things when I see them, but I generally find (even with the uploaded snapshots) that getting SDL bindings to Perl to work is a PITA ... which is why frozen bubble's Deb-package, instead of requiring sdl-perl, actually brings along it's own tweaked copy. Chromatic has "snapshots" on his web site that may work better than the ones on CPAN, but in general you have about a 50% chance of getting it to work on a given system ...

I'm seriously considering just doing my gaming development in C -- same story with trying to get decent OpenGL bindings to work. (I don't know if OpenAL even exists for Perl yet). C just works. You won't be able to use Inline::C because both of these things have event loops that want to take over your program, and the embedded perl interpreter requirements are kind of hostile. As much as a love high level languages, library support (when callbacks are required) is always a sore point. Possibly I might embed lua...

I know, it's not the answer you want. Heck, it's not the answer I want ...

  • Comment on Re^2: How can I make sounds in my Perl game scripts?

Replies are listed 'Best First'.
Re^3: How can I make sounds in my Perl game scripts?
by sfink (Deacon) on Oct 09, 2004 at 17:15 UTC
    I use OpenGL::Simple. I've been very happy with it so far, although I haven't tried to do anything very complicated. (Although I mix it in with some pretty complicated OpenGL calls made directly from C++ code, and that works fine.)

    I also am doing what you say doesn't work very well -- I have a large C++ application with an embedded perl interpreter, and I use both OpenGL::Simple and Inline::CPP (extensively) to provide the glue between perl and C/C++. And I use my own event loop. For the embedded interpreter, I just had to give up on any notion of modularity and allow it to use all of its global variables and related nastiness. The result seems to work fine. I don't make heavy use of callbacks, but I do use them.

    That said, it's quite a big chunk to get working nicely together, and it's busywork that has little to do with the main part of writing a game. It would be nice to have a prefabricated framework with all these things mixed in. (I didn't mind doing it, because I was getting paid for it. And I was really just adding scripting to an existing framework. Can't release it as open source, sorry.)

    I can't really address the OP's question. For sound, I use SDL_mixer, but I only call it from within C++. In practice, I often trigger sounds via perl scripts, but they're just manipulating a sound node written in C++, not directly triggering sound playing. Again, probably too much framework for a straightforward game. Although an Inline::C wrapper to call SDL_mixer functions would be pretty darn easy to write.

    Inline::C is awesome. Just thought I should mention that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://397658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found