include/SDL_main.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 28 May 2006 13:04:16 +0000
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1466 3c45c578d480
child 1668 4da1ee79c9af
permissions -rw-r--r--
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.

WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.

The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce

The headers are being converted to automatically generate doxygen documentation.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 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 /* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
    29 
    30 #if defined(__WIN32__) || \
    31     (defined(__MWERKS__) && !defined(__BEOS__)) || \
    32     defined(__MACOS__) || defined(__MACOSX__) || \
    33     defined(__SYMBIAN32__) || defined(QWS)
    34 
    35 #ifdef __cplusplus
    36 #define C_LINKAGE	"C"
    37 #else
    38 #define C_LINKAGE
    39 #endif /* __cplusplus */
    40 
    41 /* The application's main() function must be called with C linkage,
    42    and should be declared like this:
    43 #ifdef __cplusplus
    44 extern "C"
    45 #endif
    46 	int main(int argc, char *argv[])
    47 	{
    48 	}
    49  */
    50 #define main	SDL_main
    51 
    52 /* The prototype for the application's main() function */
    53 extern C_LINKAGE int SDL_main (int argc, char *argv[]);
    54 
    55 
    56 /* From the SDL library code -- needed for registering the app on Win32 */
    57 #ifdef __WIN32__
    58 
    59 #include "begin_code.h"
    60 #ifdef __cplusplus
    61 /* *INDENT-OFF* */
    62 extern "C" {
    63 /* *INDENT-ON* */
    64 #endif
    65 
    66 /* This should be called from your WinMain() function, if any */
    67 extern DECLSPEC void SDLCALL SDL_SetModuleHandle (void *hInst);
    68 /* This can also be called, but is no longer necessary */
    69 extern DECLSPEC int SDLCALL SDL_RegisterApp (char *name, Uint32 style,
    70                                              void *hInst);
    71 /* This can also be called, but is no longer necessary (SDL_Quit calls it) */
    72 extern DECLSPEC void SDLCALL SDL_UnregisterApp (void);
    73 #ifdef __cplusplus
    74 /* *INDENT-OFF* */
    75 }
    76 /* *INDENT-ON* */
    77 #endif
    78 #include "close_code.h"
    79 #endif
    80 
    81 /* From the SDL library code -- needed for registering QuickDraw on MacOS */
    82 #if defined(__MACOS__)
    83 
    84 #include "begin_code.h"
    85 #ifdef __cplusplus
    86 /* *INDENT-OFF* */
    87 extern "C" {
    88 /* *INDENT-ON* */
    89 #endif
    90 
    91 /* Forward declaration so we don't need to include QuickDraw.h */
    92 struct QDGlobals;
    93 
    94 /* This should be called from your main() function, if any */
    95 extern DECLSPEC void SDLCALL SDL_InitQuickDraw (struct QDGlobals *the_qd);
    96 
    97 #ifdef __cplusplus
    98 /* *INDENT-OFF* */
    99 }
   100 /* *INDENT-ON* */
   101 #endif
   102 #include "close_code.h"
   103 #endif
   104 
   105 #endif /* Need to redefine main()? */
   106 
   107 #endif /* _SDL_main_h */
   108 
   109 /* vi: set ts=4 sw=4 expandtab: */