SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

SDL_main.h File Reference

SDL_main.h File Reference

Redefine main() on some platforms so that it is called by SDL. More...

Go to the source code of this file.

Functions

C_LINKAGE int SDL_main (int argc, char *argv[])
 The prototype for the application's main() function.
DECLSPEC void SDLCALL SDL_SetMainReady (void)
 This is called by the real SDL main function to let the rest of the library know that initialization was done properly.
DECLSPEC int SDLCALL SDL_RegisterApp (char *name, Uint32 style, void *hInst)
 This can be called to set the application class at startup.

Detailed Description

Redefine main() on some platforms so that it is called by SDL.

The application's main() function must be called with C linkage, and should be declared like this:

  #ifdef __cplusplus
  extern "C"
  #endif
  int main(int argc, char *argv[])
  {
  }

Definition in file SDL_main.h.


Function Documentation

C_LINKAGE int SDL_main ( int  argc,
char *  argv[] 
)

The prototype for the application's main() function.

DECLSPEC int SDLCALL SDL_RegisterApp ( char *  name,
Uint32  style,
void *  hInst 
)

This can be called to set the application class at startup.

DECLSPEC void SDLCALL SDL_SetMainReady ( void   )

This is called by the real SDL main function to let the rest of the library know that initialization was done properly.

Calling this yourself without knowing what you're doing can cause crashes and hard to diagnose problems with your application.