Thread return code?

Is it useful to have a thread exit code, which can be retrieved with
SDL_WaitThread()?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

I’m having some trouble copying the surface format information from a loaded
BMP surface to the screen’s surface so that I may play with the screen
surface’s palette after the picture has been BLIT to the screen surface. What
steps would I need to take to ensure that the formats (palette and all) would
be the same for both the picture and screen surfaces.

Thanks
Alex—
[alex southgate]
[@Alexander_Southgate]
[(212)677-2977]

I’m having some trouble copying the surface format information from a loaded
BMP surface to the screen’s surface so that I may play with the screen
surface’s palette after the picture has been BLIT to the screen surface. What
steps would I need to take to ensure that the formats (palette and all) would
be the same for both the picture and screen surfaces.

Call SDL_DisplayFormat() on the loaded BMP’s surface (read the docs)

Once you do this, the returned surface will have the same format as the
screen, but if you change the display palette, it won’t update the BMP
surface’s palette. This may or may not be what you want.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Yes. I believe it would. That way, if a thread gets an error, it can
just return instead of trying to set a flag and hoping the rest of the
program picks it up.On 23 Mar, Sam Lantinga wrote:

Is it useful to have a thread exit code, which can be retrieved with
SDL_WaitThread()?


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

It seems that I was calling DisplayFormat with the following flags:
(SDL_ANYFORMAT|SDL_FULLSCREEN|SDL_DOUBLEBUF) which didn’t seem to be creating
the surface correctly (I specified an 8-bit surface, but when I checked
screen->format->BitsPerPixel I got 16) so I changed the flags to just
SDL_SWSURFACE and the surface looks as if it were created correctly. Any ideas
why this might happen?On 24-Mar-99 Sam Lantinga wrote:

I’m having some trouble copying the surface format information from a loaded
BMP surface to the screen’s surface so that I may play with the screen
surface’s palette after the picture has been BLIT to the screen surface.
What
steps would I need to take to ensure that the formats (palette and all)
would
be the same for both the picture and screen surfaces.

Call SDL_DisplayFormat() on the loaded BMP’s surface (read the docs)

Once you do this, the returned surface will have the same format as the
screen, but if you change the display palette, it won’t update the BMP
surface’s palette. This may or may not be what you want.

  -Sam Lantinga                           (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/


[alex southgate]
[@Alexander_Southgate]
[(212)677-2977]

It seems that I was calling DisplayFormat with the following flags:
(SDL_ANYFORMAT|SDL_FULLSCREEN|SDL_DOUBLEBUF) which didn’t seem to be creating
the surface correctly (I specified an 8-bit surface, but when I checked
screen->format->BitsPerPixel I got 16) so I changed the flags to just
SDL_SWSURFACE and the surface looks as if it were created correctly. Any ideas
why this might happen?

That’s what SDL_ANYFORMAT means:
If SDL_ANYFORMAT is set in ‘flags’, the SDL library will try to set the
requested bits-per-pixel, but will return whatever video pixel format is
available. The default is to emulate the requested pixel format if it is
not natively available.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/