ezEngine  Milestone 7
ApplicationEntryPoint_posix.h
Go to the documentation of this file.
1 
2 #pragma once
3 
5 
6 
8 #define EZ_CONSOLEAPP_ENTRY_POINT EZ_APPLICATION_ENTRY_POINT
9 
10 
15 #define EZ_APPLICATION_ENTRY_POINT(AppClass, ...) \
16  static char appBuffer[sizeof(AppClass)]; /* Not on the stack to cope with smaller stacks */ \
17  \
18  int main(int argc, const char** argv) \
19  { \
20  \
21  AppClass* pApp = new (appBuffer) AppClass(__VA_ARGS__); \
22  pApp->SetCommandLineArguments((ezUInt32) argc, argv); \
23  ezRun(pApp); /* Life cycle & run method calling */ \
24  int iReturnCode = pApp->GetReturnCode(); \
25  pApp->~AppClass(); \
26  memset(pApp, 0, sizeof(AppClass)); \
27  return iReturnCode; \
28  }
29