SDL_Mixer problems

I’m trying to play a music mod at half volume.
I thought the following sample of code would do exactly that.
I’m finding that a value of 0 passed to Mix_PlayMusic sets the volume to 0,
and any other positive value up to 128 sets it to full volume.

Mix_Music *music = NULL;
Mix_VolumeMusic(64);
music = Mix_LoadMUS(filename);
Mix_PlayMusic(music, 0);

I’m using SDL 1.2.0 and SDL_Mixer 1.2.0

A second, and even dumber problem on my part, is I can’t work out how to
protect my image data under windows when Windows is invoked while playinga
full screen game and then the game is brought to focus again.
I know I’ve seen the code on the web site for protecting hardware surfaces,
but I’ve looked a heap again and can’t find any reference to the problem.

I assume I need a thread to check for the problem or something … ?_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

A second, and even dumber problem on my part, is I can’t work out how to
protect my image data under windows when Windows is invoked while playinga
full screen game and then the game is brought to focus again.

You can’t. You actually have to reload the image data.

See ya,
-Sam Lantinga, Lead Programmer, Loki Software, Inc.

Oh dear.

How do I check when my images are lost. Can I set up a separate process, or
some sort of an event?>From: Sam Lantinga

Reply-To: sdl at lokigames.com
To: sdl at lokigames.com
Subject: Re: [SDL] SDL_Mixer problems
Date: Sat, 09 Jun 2001 11:20:58 -0700

A second, and even dumber problem on my part, is I can’t work out how to
protect my image data under windows when Windows is invoked while
playinga
full screen game and then the game is brought to focus again.

You can’t. You actually have to reload the image data.

See ya,
-Sam Lantinga, Lead Programmer, Loki Software, Inc.


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

A second, and even dumber problem on my part, is I can’t work out how to
protect my image data under windows when Windows is invoked while playinga
full screen game and then the game is brought to focus again.

You can’t. You actually have to reload the image data.

See ya,
-Sam Lantinga, Lead Programmer, Loki Software, Inc.

with a -2 error code, that means that the image was corrupted. Do
all the images need to be reloaded? Are the SDL_Surface pointers
to the images I’m blitting invalid at this point? What would be a good
check on this?

I figure that if blitting returns with an error code, go through and check
all the images that need to be blitted, and then SDL_Free the surface,
then reload?

Correct me if I’m wrong, I’m just trying to comprehend…

-Rob
rppowell at gizmonet.netOn Sat, 9 Jun 2001, Sam Lantinga wrote:

From my understanding, when you try to blit (SDL_Blit), and it returns