Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2700) SDL_init can only be called once
Home

[Freeciv-Dev] (PR#2700) SDL_init can only be called once

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#2700) SDL_init can only be called once
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 1 Jan 2003 17:32:51 -0800
Reply-to: rt@xxxxxxxxxxxxxx

SDL_init() cannot generally be called more than once.  Even if you
uninitialize SDL, you can't call it again.  And this means SDL sound
doesn't work with the SDL client, since both call SDL_init.

The fix should introduce a common client method of initializing SDL. 
Something like init_sdl(options) which will only initialize once.  And
SDL should not be uninitted until the client exits (for instance when we
uninitialize a sound module it should not be done, since we may switch
back to that sound module later).

autoconf changes may also be needed to see if any SDL users are being
compiled.  The check could be something like
  #if defined SDL_AUDIO or defined SDL_CLIENT
or
  #ifdef USING_SDL

A patch for this would be welcome.

jason



[Prev in Thread] Current Thread [Next in Thread]