include/SDL.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 06 Jul 2013 12:28:57 -0700
changeset 7360 b86947ea2749
parent 7191 75360622e65f
child 7370 9af77b0c7c93
permissions -rw-r--r--
Make it possible to use SDL events separately from the video subsystem.
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
slouken@0
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@0
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@0
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@0
    20
*/
slouken@0
    21
slouken@1895
    22
/**
slouken@3407
    23
 *  \file SDL.h
slouken@7191
    24
 *
slouken@3407
    25
 *  Main include header for the SDL library
slouken@1895
    26
 */
slouken@3407
    27
slouken@1895
    28
/**
slouken@3407
    29
 *  \mainpage Simple DirectMedia Layer (SDL)
slouken@7191
    30
 *
slouken@3407
    31
 *  http://www.libsdl.org/
slouken@7191
    32
 *
slouken@3407
    33
 *  \section intro_sec Introduction
slouken@7191
    34
 *
slouken@3407
    35
 *  This is the Simple DirectMedia Layer, a general API that provides low
slouken@3407
    36
 *  level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
slouken@3407
    37
 *  and 2D framebuffer across multiple platforms.
slouken@7191
    38
 *
slouken@3407
    39
 *  SDL is written in C, but works with C++ natively, and has bindings to
slouken@3407
    40
 *  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
slouken@3407
    41
 *  Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
slouken@3407
    42
 *  Pike, Pliant, Python, Ruby, and Smalltalk.
slouken@7191
    43
 *
slouken@7022
    44
 *  This library is distributed under the zlib license, which can be
slouken@3407
    45
 *  found in the file  "COPYING".  This license allows you to use SDL
slouken@7022
    46
 *  freely for any purpose as long as you retain the copyright notice.
slouken@7191
    47
 *
slouken@3407
    48
 *  The best way to learn how to use SDL is to check out the header files in
slouken@3407
    49
 *  the "include" subdirectory and the programs in the "test" subdirectory.
slouken@3407
    50
 *  The header files and test programs are well commented and always up to date.
slouken@6878
    51
 *  More documentation and FAQs are available online at:
slouken@7191
    52
 *      http://wiki.libsdl.org/
slouken@7191
    53
 *
slouken@3407
    54
 *  If you need help with the library, or just want to discuss SDL related
slouken@3407
    55
 *  issues, you can join the developers mailing list:
slouken@7191
    56
 *      http://www.libsdl.org/mailing-list.php
slouken@7191
    57
 *
slouken@3407
    58
 *  Enjoy!
slouken@7191
    59
 *      Sam Lantinga                (slouken@libsdl.org)
slouken@1895
    60
 */
slouken@0
    61
slouken@0
    62
#ifndef _SDL_H
slouken@0
    63
#define _SDL_H
slouken@0
    64
slouken@1423
    65
#include "SDL_main.h"
slouken@1353
    66
#include "SDL_stdinc.h"
slouken@5347
    67
#include "SDL_assert.h"
slouken@5017
    68
#include "SDL_atomic.h"
slouken@0
    69
#include "SDL_audio.h"
slouken@4493
    70
#include "SDL_clipboard.h"
slouken@1358
    71
#include "SDL_cpuinfo.h"
slouken@1358
    72
#include "SDL_endian.h"
slouken@1358
    73
#include "SDL_error.h"
slouken@0
    74
#include "SDL_events.h"
icculus@6918
    75
#include "SDL_joystick.h"
slouken@6690
    76
#include "SDL_gamecontroller.h"
icculus@6918
    77
#include "SDL_haptic.h"
slouken@5189
    78
#include "SDL_hints.h"
slouken@1358
    79
#include "SDL_loadso.h"
slouken@5221
    80
#include "SDL_log.h"
slouken@6602
    81
#include "SDL_messagebox.h"
slouken@1358
    82
#include "SDL_mutex.h"
icculus@3170
    83
#include "SDL_power.h"
slouken@5145
    84
#include "SDL_render.h"
slouken@1358
    85
#include "SDL_rwops.h"
slouken@6342
    86
#include "SDL_system.h"
slouken@1358
    87
#include "SDL_thread.h"
slouken@1358
    88
#include "SDL_timer.h"
slouken@3647
    89
#include "SDL_version.h"
slouken@0
    90
#include "SDL_video.h"
slouken@0
    91
slouken@0
    92
#include "begin_code.h"
slouken@0
    93
/* Set up for C function definitions, even when using C++ */
slouken@0
    94
#ifdef __cplusplus
slouken@0
    95
extern "C" {
slouken@0
    96
#endif
slouken@0
    97
slouken@0
    98
/* As of version 0.5, SDL is loaded dynamically into the application */
slouken@0
    99
slouken@3407
   100
/**
slouken@3407
   101
 *  \name SDL_INIT_*
slouken@7191
   102
 *
slouken@3407
   103
 *  These are the flags which may be passed to SDL_Init().  You should
slouken@3407
   104
 *  specify the subsystems which you will be using in your application.
slouken@3407
   105
 */
slouken@3407
   106
/*@{*/
slouken@2713
   107
#define SDL_INIT_TIMER          0x00000001
slouken@2713
   108
#define SDL_INIT_AUDIO          0x00000010
slouken@7360
   109
#define SDL_INIT_VIDEO          0x00000020  /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
slouken@7360
   110
#define SDL_INIT_JOYSTICK       0x00000200  /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
slouken@2713
   111
#define SDL_INIT_HAPTIC         0x00001000
slouken@7360
   112
#define SDL_INIT_GAMECONTROLLER 0x00002000  /**< SDL_INIT_GAMECONTROLLE implies SDL_INIT_JOYSTICK */
slouken@7360
   113
#define SDL_INIT_EVENTS         0x00004000
slouken@7360
   114
#define SDL_INIT_NOPARACHUTE    0x00100000  /**< Don't catch fatal signals */
icculus@6981
   115
#define SDL_INIT_EVERYTHING ( \
slouken@7360
   116
                SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
icculus@6981
   117
                SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
icculus@6981
   118
            )
slouken@3407
   119
/*@}*/
slouken@0
   120
slouken@3348
   121
/**
slouken@4863
   122
 *  This function initializes  the subsystems specified by \c flags
slouken@3407
   123
 *  Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
slouken@3407
   124
 *  signal handlers for some commonly ignored fatal signals (like SIGSEGV).
slouken@0
   125
 */
slouken@337
   126
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
slouken@0
   127
slouken@3348
   128
/**
slouken@3407
   129
 *  This function initializes specific SDL subsystems
slouken@3348
   130
 */
slouken@337
   131
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
slouken@0
   132
slouken@3407
   133
/**
slouken@3407
   134
 *  This function cleans up specific SDL subsystems
slouken@3407
   135
 */
slouken@337
   136
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
slouken@0
   137
slouken@3348
   138
/**
slouken@4627
   139
 *  This function returns a mask of the specified subsystems which have
slouken@4627
   140
 *  previously been initialized.
slouken@7191
   141
 *
slouken@3407
   142
 *  If \c flags is 0, it returns a mask of all initialized subsystems.
slouken@3407
   143
 */
slouken@337
   144
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
slouken@0
   145
slouken@3348
   146
/**
slouken@4627
   147
 *  This function cleans up all initialized subsystems. You should
slouken@4627
   148
 *  call it upon all exit conditions.
slouken@0
   149
 */
slouken@337
   150
extern DECLSPEC void SDLCALL SDL_Quit(void);
slouken@0
   151
slouken@0
   152
/* Ends C function definitions when using C++ */
slouken@0
   153
#ifdef __cplusplus
slouken@0
   154
}
slouken@0
   155
#endif
slouken@0
   156
#include "close_code.h"
slouken@0
   157
slouken@0
   158
#endif /* _SDL_H */
slouken@1895
   159
slouken@1895
   160
/* vi: set ts=4 sw=4 expandtab: */