ezEngine  Milestone 9
ApplicationEntryPoint_win.h File Reference
#include <Foundation/Memory/MemoryTracker.h>

Go to the source code of this file.

Macros

#define EZ_CONSOLEAPP_ENTRY_POINT(AppClass, ...)
 Same as EZ_APPLICATION_ENTRY_POINT but should be used for applications that shall always show a console window. More...
 
#define EZ_APPLICATION_ENTRY_POINT(AppClass, ...)
 This macro allows for easy creation of application entry points (since they can't be placed in DLLs) More...
 

Functions

template<typename AppClass , typename... Args>
int Details::ConsoleEntry (int argc, const char **argv, Args &&... arguments)
 
template<typename AppClass , typename... Args>
int Details::ApplicationEntry (Args &&... arguments)
 

Macro Definition Documentation

◆ EZ_APPLICATION_ENTRY_POINT

#define EZ_APPLICATION_ENTRY_POINT (   AppClass,
  ... 
)
Value:
/* Enables that on machines with multiple GPUs the NVIDIA GPU is preferred */ \
extern "C" { \
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; \
} \
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) \
{ \
return Details::ApplicationEntry<AppClass>(__VA_ARGS__); \
}

This macro allows for easy creation of application entry points (since they can't be placed in DLLs)

Just use the macro in a cpp file of your application and supply your app class (must be derived from ezApplication). The additional (optional) parameters are passed to the constructor of your app class.

◆ EZ_CONSOLEAPP_ENTRY_POINT

#define EZ_CONSOLEAPP_ENTRY_POINT (   AppClass,
  ... 
)
Value:
/* Enables that on machines with multiple GPUs the NVIDIA GPU is preferred */ \
extern "C" { \
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; \
} \
int main(int argc, const char** argv) { return Details::ConsoleEntry<AppClass>(argc, argv, __VA_ARGS__); }

Same as EZ_APPLICATION_ENTRY_POINT but should be used for applications that shall always show a console window.