Advertisement Jump to content
Sign in to follow this  

SDL - Passing Mix_Chunk by reference

This topic is 4973 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

Hi, Following my post in For Beginners, I've basically discovered what the problem I faced was - I need to be able to pass Mix_Chunk by reference. I have an audio "surface" called Mix_Chunk *soundbite (it's purely for testing just now, I'm going to expand my solution later). It gets passed into 3 different functions as a parameter - one for loading a wav file, one for playing it and one for freeing it again. At the current time, I'm using pointers, therefore passing by value, which in turn means that the version of soundbite passed in to each function is different, thus causing the error of it being NULL when the player function tries to play it. The correct "version" of soundbite only exists within the load function, as it does when you use pointers. Is it possible to pass Mix_Chunk variables by reference at all? If so, what's the exact syntax for doing it? That would mean the same thing reaches every function, meaning it'll work :) Thanks, ukdeveloper. [Edited by - ukdeveloper on June 11, 2005 10:00:09 AM]

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!