[SDL2] - SDL_Init in SDL2 is not necessary?

vcexpress2008

read the tests demo in SDL2 using common.c/common.h, and i did not find “SDL_Init” invoked.

in “loopwave” demo(loopwave.c),i comment the “SDL_Init” and relative code, the demo still works fine.

is that mean SDL_Init do not necessary?

SDL_Init or SDL_InitSubSystem will be invoked automatically when necessary??

SDL_Init should be invoked (and I don’t think SDL_InitSubSystem alone
works)… if anything works without it then consider it a fluke and
undefined behavior (exception: the new message boxes functions, as
those are meant to work even if SDL itself fails).

2012/11/19 sonicer :> SDL_Init or SDL_InitSubSystem will be invoked automatically when necessary??


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It may work on your platform, but may not on others… Some platforms need more “up-front” initialization than others… So you should ALWAYS SDL_Init.On Nov 22, 2012, at 16:13 , Sik the hedgehog wrote:

SDL_Init should be invoked (and I don’t think SDL_InitSubSystem alone
works)… if anything works without it then consider it a fluke and
undefined behavior (exception: the new message boxes functions, as
those are meant to work even if SDL itself fails).

2012/11/19 sonicer :

SDL_Init or SDL_InitSubSystem will be invoked automatically when necessary??


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
317-674-3296