The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Migration paragraph about SDL_main is confusing - rewording
Jonas Thiem
Guest

Hi,

This mail has two parts.
1. Part: I would like to change the wording in the wiki of a paragraph
where my technical knowledge isn't 100%, so feel free to review before
I do that
2. Part: Technical question about a possible mistake in the wiki

=== PART 1: WIKI WORDING CHANGE ===
I found this paragraph in the Migration Guide about SDL_main to be confusing:

(wiki quote)
There's no SDL_main! Well, okay, there is, and it now does what it was
always meant to: be a small piece of code that hides the difference
between main() and WinMain() on Windows. There's no initialization
code in it, and it's completely optional. This means you can use SDL
without it taking over your mainline, which is nice for plugins that
use SDL, or scripting languages with an SDL module. All the stuff
you'd want the 1.2 SDL_main for is now in SDL_Init() where it belongs.


The Yes it is gone! No it isn't! Well maybe a bit! wording is just
very confusing, and I would suggest this:

(suggested change)
The SDL_main which injects an alternative main as in SDL 1.2 can now
be disabled on Windows since it no longer contains any vital
initialization code. It is gone from Mac OS X completely, and while it
is still around on Windows, only to hide the difference between main()
and WinMain() for your convenience, it is entirely optional. The
initialization code from the 1.2 SDL_Main is now all in SDL_Init()
where it belongs. However, for the mobile platforms (WinRT, Android,
iOS) the SDL_Main mechanism is still required.

=== PART 2: TECHNICAL QUESTION ===
I stumbled across another issue however: the SDL_SetMainReady(); call.
A person in the channel said they experienced problems not calling
this before SDL_Init, which would be exactly the OPPOSITE of what the
wiki says (SDL_main still contains vital initialization code on
Windows). Can anyone clear up what SDL_SetMainReady(); is for, and if
it is still necessary? If not, why is it called from SDL_Main at all?

I will then attempt to use this knowledge to have the wiki be correct
and understandable in that regard if I can. Thanks!

Regards,
Jonas Thiem

PS: I have wiki write access so this is just a request to help me do a
good change, not a request to change it for me in the wiki or
something
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org