include/SDL_main.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 12 Jan 2011 15:42:26 -0800
changeset 4986 8431f59485d0
parent 4952 18fe0aded409
child 5062 e8916fe9cfc8
permissions -rw-r--r--
Renderer didn't advertise texture format SDL_PIXELFORMAT_ABGR8888
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifndef _SDL_main_h
    24 #define _SDL_main_h
    25 
    26 #include "SDL_stdinc.h"
    27 
    28 /**
    29  *  \file SDL_main.h
    30  *  
    31  *  Redefine main() on some platforms so that it is called by SDL.
    32  */
    33 
    34 #if defined(__WIN32__) || \
    35     (defined(__MWERKS__) && !defined(__BEOS__)) || \
    36     defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
    37     defined(__ANDROID__)
    38 
    39 #ifdef __cplusplus
    40 #define C_LINKAGE	"C"
    41 #else
    42 #define C_LINKAGE
    43 #endif /* __cplusplus */
    44 
    45 /**
    46  *  \file SDL_main.h
    47  *
    48  *  The application's main() function must be called with C linkage,
    49  *  and should be declared like this:
    50  *  \code
    51  *  #ifdef __cplusplus
    52  *  extern "C"
    53  *  #endif
    54  *  int main(int argc, char *argv[])
    55  *  {
    56  *  }
    57  *  \endcode
    58  */
    59 
    60 #define main	SDL_main
    61 
    62 /**
    63  *  The prototype for the application's main() function
    64  */
    65 extern C_LINKAGE int SDL_main(int argc, char *argv[]);
    66 
    67 
    68 /* From the SDL library code -- needed for registering the app on Win32 */
    69 #ifdef __WIN32__
    70 
    71 #include "begin_code.h"
    72 #ifdef __cplusplus
    73 /* *INDENT-OFF* */
    74 extern "C" {
    75 /* *INDENT-ON* */
    76 #endif
    77 
    78 /**
    79  *  This can be called to set the application class at startup
    80  */
    81 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
    82                                             void *hInst);
    83 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
    84 
    85 #ifdef __cplusplus
    86 /* *INDENT-OFF* */
    87 }
    88 /* *INDENT-ON* */
    89 #endif
    90 #include "close_code.h"
    91 #endif
    92 
    93 #endif /* Need to redefine main()? */
    94 
    95 #endif /* _SDL_main_h */
    96 
    97 /* vi: set ts=4 sw=4 expandtab: */