SDL  2.0
SDL_main.h File Reference
#include "SDL_stdinc.h"
#include "begin_code.h"
#include "close_code.h"
+ Include dependency graph for SDL_main.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SDL_MAIN_AVAILABLE
 
#define SDLMAIN_DECLSPEC
 
#define main   SDL_main
 

Typedefs

typedef int(* SDL_main_func) (int argc, char *argv[])
 

Functions

SDLMAIN_DECLSPEC int SDL_main (int argc, char *argv[])
 
void SDL_SetMainReady (void)
 
int SDL_RegisterApp (char *name, Uint32 style, void *hInst)
 
void SDL_UnregisterApp (void)
 

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.

Macro Definition Documentation

◆ main

#define main   SDL_main

Definition at line 109 of file SDL_main.h.

◆ SDL_MAIN_AVAILABLE

#define SDL_MAIN_AVAILABLE

Definition at line 40 of file SDL_main.h.

◆ SDLMAIN_DECLSPEC

#define SDLMAIN_DECLSPEC

Definition at line 90 of file SDL_main.h.

Typedef Documentation

◆ SDL_main_func

typedef int(* SDL_main_func) (int argc, char *argv[])

The prototype for the application's main() function

Definition at line 120 of file SDL_main.h.

Function Documentation

◆ SDL_main()

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

Referenced by main(), and WinMain().

◆ SDL_RegisterApp()

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

This can be called to set the application class at startup

◆ SDL_SetMainReady()

void 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.

Definition at line 100 of file SDL.c.

101 {
103 }

References SDL_MainIsReady, and SDL_TRUE.

◆ SDL_UnregisterApp()

void SDL_UnregisterApp ( void  )
main
#define main
Definition: SDL_main.h:109
SDL_TRUE
Definition: SDL_stdinc.h:164
SDL_MainIsReady
static SDL_bool SDL_MainIsReady
Definition: SDL.c:52