src/main/windowsrt/SDL_winrt_main.cpp
author David Ludwig <dludwig@pobox.com>
Thu, 22 Nov 2012 22:36:34 -0500
changeset 8355 f73480bf3e55
permissions -rw-r--r--
WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8355
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     1
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     2
//#include "pch.h"
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     3
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     4
// The app's C-style main will be passed into SDL.dll as a function
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     5
// pointer, and called at the appropriate time.
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     6
typedef int (*SDLmain_MainFunction)(int, char **);
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     7
extern __declspec(dllimport) int SDL_WinRT_RunApplication(SDLmain_MainFunction mainFunction);
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     8
extern "C" int SDL_main(int, char **);
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
     9
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
    10
[Platform::MTAThread]
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
    11
int main(Platform::Array<Platform::String^>^)
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
    12
{
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
    13
    return SDL_WinRT_RunApplication(SDL_main);
f73480bf3e55 WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
David Ludwig <dludwig@pobox.com>
parents:
diff changeset
    14
}