[SDL] odd crash with SDL2

D B buckyballreaction at gmail.com
Mon Mar 18 23:32:45 PDT 2013


I find SDL_INIT_EVERYTHING useful, I have a base engine function that turns SDL on and off at the correct point in engine execution, and then all the leaf code is free to use SDL as it sees fit. Having each user of SDL functionality have to initialize (and de-init) the subsystem they want would be much more error prone, the small extra initial startup cost is well worth the reliability.
Keeping the flag does mean we can't do destructive or intrusive operations on init (for example, start recording a video feed from an attached camera), but I would argue that init should never have those behaviors.

- Alfred


From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On Behalf Of Sam Lantinga
Sent: Tuesday, March 05, 2013 10:17 AM
To: SDL Development List
Subject: Re: [SDL] SDL 2.0 API stabilization

I'm fine with removing SDL_INIT_EVERYTHING.
On Mon, Mar 4, 2013 at 9:04 PM, Jared Maddox <absinthdraco at gmail.com<mailto:absinthdraco at gmail.com>> wrote:
> Date: Sun, 03 Mar 2013 22:21:02 -0500
> From: "Ryan C. Gordon" <icculus at icculus.org<mailto:icculus at icculus.org>>
> To: SDL Development List <sdl at lists.libsdl.org<mailto:sdl at lists.libsdl.org>>
> Subject: Re: [SDL] SDL 2.0 API stabilization
> Message-ID: <5134131E.6060101 at icculus.org<mailto:5134131E.6060101 at icculus.org>>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 3/3/13 12:09 AM, Sik the hedgehog wrote:
>> Yeah, that seems better. I realized later that SDL_INIT_TOUCH would
>> result in programs using SDL_INIT_EVERYTHING to not get emulated touch
>> input, but I was away by then :/ (honestly using SDL_INIT_EVERYTHING
>> isn't a good idea in the first place, but eh)
>
> Actually, that's a good point: should we nuke SDL_INIT_EVERYTHING from
> SDL 2.0?
>
> I mean, if we add a new subsystem, and someone has written...
>
>     if (SDL_Init(SDL_INIT_EVERYTHING) == -1)
>         exit(1);
>
> ...then their working program might break when they don't have some
> exotic new functionality on their platform.
>
We could have a function that just returns the newest value for
SDL_INIT_EVERYTHING, but then we'd have to load SDL before SDL_Init()
even gets called. Unless you want to separate the loading stage and
the initialization stage, *_EVERYTHING should be either removed... or
changed to a discrete bit flag like all of the other init flags.

Probably it should just be removed.


> Date: Sun, 03 Mar 2013 22:23:04 -0500
> From: "Ryan C. Gordon" <icculus at icculus.org<mailto:icculus at icculus.org>>
> To: SDL Development List <sdl at lists.libsdl.org<mailto:sdl at lists.libsdl.org>>
> Subject: Re: [SDL] SDL 2.0 API stabilization
> Message-ID: <51341398.2010406 at icculus.org<mailto:51341398.2010406 at icculus.org>>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>

> ...while I'm thinking about it, should we roll SDL_INIT_HAPTIC and
> SDL_INIT_GAMECONTROLLER into SDL_INIT_JOYSTICK?
>
Don't some mice have haptic capabilities (I half-recall magazine ads)?
Other than that, it makes sense to me.
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org<mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130305/0af783f5/attachment-0008.htm>


More information about the SDL mailing list