World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_main.h

См. исходные тексты.

Определения типов

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

Функции

SDLMAIN_DECLSPEC int SDL_main (int argc, char *argv[])
 
DECLSPEC void SDLCALL SDL_SetMainReady (void)
 
DECLSPEC int SDLCALL SDL_RegisterApp (char *name, Uint32 style, void *hInst)
 
DECLSPEC void SDLCALL SDL_UnregisterApp (void)
 
DECLSPEC int SDLCALL SDL_WinRTRunApp (SDL_main_func mainFunction, void *reserved)
 Initializes and launches an SDL/WinRT application. Подробнее...
 
DECLSPEC int SDLCALL SDL_UIKitRunApp (int argc, char *argv[], SDL_main_func mainFunction)
 Initializes and launches an SDL application. Подробнее...
 

Подробное описание

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[])
{
}

См. определение в файле SDL_main.h

Типы

◆ SDL_main_func

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

The prototype for the application's main() function

См. определение в файле SDL_main.h строка 120

Функции

◆ SDL_main()

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

См. определение в файле SDLmain.cpp строка 5

5  {
6  std::string cmd;
7  for (int i = 1; i < argc; ++i) {
8  cmd += std::string(argv[i]) + " ";
9  }
10 
11  int res = -1;
12  if (SDL_Init(SDL_INIT_VIDEO) >= 0) {
13  extern int MM_Main(const char *);
14  res = MM_Main(cmd.c_str());
15 
16  SDL_Quit();
17  }
18 
19  return res;
20 }

Перекрестные ссылки MM_Main(), SDL_Init() и SDL_Quit().

+ Граф вызовов:

◆ SDL_SetMainReady()

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.

◆ SDL_RegisterApp()

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

This can be called to set the application class at startup

◆ SDL_UnregisterApp()

DECLSPEC void SDLCALL SDL_UnregisterApp ( void  )

◆ SDL_WinRTRunApp()

DECLSPEC int SDLCALL SDL_WinRTRunApp ( SDL_main_func  mainFunction,
void reserved 
)

Initializes and launches an SDL/WinRT application.

Аргументы
mainFunctionThe SDL app's C-style main().
reservedReserved for future use; should be NULL
Возвращает
0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more information on the failure.

◆ SDL_UIKitRunApp()

DECLSPEC int SDLCALL SDL_UIKitRunApp ( int  argc,
char *  argv[],
SDL_main_func  mainFunction 
)

Initializes and launches an SDL application.

Аргументы
argcThe argc parameter from the application's main() function
argvThe argv parameter from the application's main() function
mainFunctionThe SDL app's C-style main().
Возвращает
the return value from mainFunction
SDL_Quit
DECLSPEC void SDLCALL SDL_Quit(void)
MM_Main
int MM_Main(const char *pCmdLine)
Definition: Game.cpp:83
SDL_Init
DECLSPEC int SDLCALL SDL_Init(Uint32 flags)
main
void main()
Definition: CMakeCCompilerId.c:592
av_intfloat64::i
uint64_t i
Definition: intfloat.h:33
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
res
GLuint res
Definition: SDL_opengl_glext.h:7940