Jump to content
  • Advertisement
Sign in to follow this  
Sir Sapo

SDL_mixer question

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I just finished coding a game I have been working on for a little bit now and I ran into a bit of a dilemma. I would like to add some sound effects and music into my game, but it is coded in OpenGL and the only sound library I know how to use is SDL_mixer. Is there a way to just initialize SDL_mixer and use it in an OpenGL program? I know some of you are going to suggest FMod, and if what I am asking is not possible, if anyone has a link to an FMod tutorial I would greatly appreciate it. P.S. The game is 2D so I dont need anything fancy like 3D sound or anything.

Share this post


Link to post
Share on other sites
Advertisement
If you want to use SDL_Mixer, you must use SDL - but you do not have to use SDL for the graphics! Basically it will work like this - you make a SDL app and initialize all of the SDL stuff. Then you just add you OpenGL code and that's it. Take a look at my little tutorial in my guide for how you setup OpenGL with SDL. After that you just add your code and then use the SDL mixer. Of course you will need to be doing quite some changing, that example is very simple and inefficient for a game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!