include/SDL_version.h
author Steven M. Vascellaro <svascellaro@gmail.com>
Mon, 22 Oct 2018 10:55:18 -0400
changeset 12379 5dc13016cf34
parent 12229 2fb171be56e0
child 12503 806492103856
permissions -rw-r--r--
joystick: Add Linux mappings for "Xbox One Wireless Controller (Model 1708)"

Adds controller bindings to support the "Xbox One Wireless Controller
(Model 1708)" on Linux. The Model 1708 was released in 2016 alongside the
Xbox One S. It is the current model being sold by Microsoft as of writing.
(October 22, 2018)
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@11811
     3
  Copyright (C) 1997-2018 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_version.h
slouken@7191
    24
 *
slouken@3407
    25
 *  This header defines the current SDL version.
slouken@1895
    26
 */
slouken@0
    27
slouken@10638
    28
#ifndef SDL_version_h_
slouken@10638
    29
#define SDL_version_h_
slouken@0
    30
slouken@1356
    31
#include "SDL_stdinc.h"
slouken@0
    32
slouken@0
    33
#include "begin_code.h"
slouken@0
    34
/* Set up for C function definitions, even when using C++ */
slouken@0
    35
#ifdef __cplusplus
slouken@0
    36
extern "C" {
slouken@0
    37
#endif
slouken@0
    38
slouken@1895
    39
/**
slouken@3407
    40
 *  \brief Information the version of SDL in use.
slouken@7191
    41
 *
slouken@3407
    42
 *  Represents the library's version as three levels: major revision
slouken@1895
    43
 *  (increments with massive changes, additions, and enhancements),
slouken@1895
    44
 *  minor revision (increments with backwards-compatible changes to the
slouken@1895
    45
 *  major revision), and patchlevel (increments with fixes to the minor
slouken@1895
    46
 *  revision).
slouken@7191
    47
 *
slouken@3407
    48
 *  \sa SDL_VERSION
slouken@3407
    49
 *  \sa SDL_GetVersion
slouken@1895
    50
 */
slouken@1895
    51
typedef struct SDL_version
slouken@1895
    52
{
slouken@1895
    53
    Uint8 major;        /**< major version */
slouken@1895
    54
    Uint8 minor;        /**< minor version */
slouken@1895
    55
    Uint8 patch;        /**< update version */
slouken@1895
    56
} SDL_version;
slouken@1895
    57
slouken@0
    58
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
slouken@0
    59
*/
slouken@7191
    60
#define SDL_MAJOR_VERSION   2
slouken@7191
    61
#define SDL_MINOR_VERSION   0
slouken@12229
    62
#define SDL_PATCHLEVEL      9
slouken@0
    63
slouken@1895
    64
/**
slouken@3407
    65
 *  \brief Macro to determine SDL version program was compiled against.
slouken@7191
    66
 *
slouken@3407
    67
 *  This macro fills in a SDL_version structure with the version of the
slouken@1895
    68
 *  library you compiled against. This is determined by what header the
slouken@1895
    69
 *  compiler uses. Note that if you dynamically linked the library, you might
slouken@1895
    70
 *  have a slightly newer or older version at runtime. That version can be
slouken@3407
    71
 *  determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
slouken@1895
    72
 *  is not a macro.
slouken@7191
    73
 *
slouken@3407
    74
 *  \param x A pointer to a SDL_version struct to initialize.
slouken@7191
    75
 *
slouken@3407
    76
 *  \sa SDL_version
slouken@3407
    77
 *  \sa SDL_GetVersion
slouken@0
    78
 */
slouken@7191
    79
#define SDL_VERSION(x)                          \
slouken@7191
    80
{                                   \
slouken@7191
    81
    (x)->major = SDL_MAJOR_VERSION;                 \
slouken@7191
    82
    (x)->minor = SDL_MINOR_VERSION;                 \
slouken@7191
    83
    (x)->patch = SDL_PATCHLEVEL;                    \
slouken@0
    84
}
slouken@0
    85
slouken@3407
    86
/**
slouken@3407
    87
 *  This macro turns the version numbers into a numeric value:
slouken@3407
    88
 *  \verbatim
slouken@3407
    89
    (1,2,3) -> (1203)
slouken@3407
    90
    \endverbatim
slouken@7191
    91
 *
slouken@3407
    92
 *  This assumes that there will never be more than 100 patchlevels.
slouken@3407
    93
 */
slouken@7191
    94
#define SDL_VERSIONNUM(X, Y, Z)                     \
slouken@7191
    95
    ((X)*1000 + (Y)*100 + (Z))
slouken@0
    96
slouken@3407
    97
/**
slouken@3407
    98
 *  This is the version number macro for the current SDL version.
slouken@3407
    99
 */
slouken@0
   100
#define SDL_COMPILEDVERSION \
slouken@7191
   101
    SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
slouken@0
   102
slouken@3407
   103
/**
slouken@3407
   104
 *  This macro will evaluate to true if compiled with SDL at least X.Y.Z.
slouken@3407
   105
 */
slouken@0
   106
#define SDL_VERSION_ATLEAST(X, Y, Z) \
slouken@7191
   107
    (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
slouken@0
   108
slouken@1895
   109
/**
slouken@3407
   110
 *  \brief Get the version of SDL that is linked against your program.
slouken@1895
   111
 *
slouken@4627
   112
 *  If you are linking to SDL dynamically, then it is possible that the
slouken@4627
   113
 *  current version will be different than the version you compiled against.
slouken@4627
   114
 *  This function returns the current version, while SDL_VERSION() is a
slouken@4627
   115
 *  macro that tells you what version you compiled with.
slouken@7191
   116
 *
slouken@3407
   117
 *  \code
slouken@3407
   118
 *  SDL_version compiled;
slouken@3407
   119
 *  SDL_version linked;
slouken@7191
   120
 *
slouken@3407
   121
 *  SDL_VERSION(&compiled);
slouken@3407
   122
 *  SDL_GetVersion(&linked);
slouken@3407
   123
 *  printf("We compiled against SDL version %d.%d.%d ...\n",
slouken@3407
   124
 *         compiled.major, compiled.minor, compiled.patch);
slouken@3407
   125
 *  printf("But we linked against SDL version %d.%d.%d.\n",
slouken@3407
   126
 *         linked.major, linked.minor, linked.patch);
slouken@3407
   127
 *  \endcode
slouken@7191
   128
 *
slouken@3407
   129
 *  This function may be called safely at any time, even before SDL_Init().
slouken@7191
   130
 *
slouken@3407
   131
 *  \sa SDL_VERSION
slouken@0
   132
 */
slouken@1895
   133
extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
slouken@0
   134
slouken@2982
   135
/**
slouken@3407
   136
 *  \brief Get the code revision of SDL that is linked against your program.
icculus@4419
   137
 *
slouken@4627
   138
 *  Returns an arbitrary string (a hash value) uniquely identifying the
slouken@4627
   139
 *  exact revision of the SDL library in use, and is only useful in comparing
slouken@4627
   140
 *  against other revisions. It is NOT an incrementing number.
slouken@2982
   141
 */
icculus@4419
   142
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
slouken@2982
   143
slouken@5359
   144
/**
slouken@5359
   145
 *  \brief Get the revision number of SDL that is linked against your program.
slouken@5359
   146
 *
slouken@5359
   147
 *  Returns a number uniquely identifying the exact revision of the SDL
slouken@5359
   148
 *  library in use. It is an incrementing number based on commits to
slouken@5359
   149
 *  hg.libsdl.org.
slouken@5359
   150
 */
slouken@5359
   151
extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
slouken@5359
   152
slouken@5359
   153
slouken@0
   154
/* Ends C function definitions when using C++ */
slouken@0
   155
#ifdef __cplusplus
slouken@0
   156
}
slouken@0
   157
#endif
slouken@0
   158
#include "close_code.h"
slouken@0
   159
slouken@10638
   160
#endif /* SDL_version_h_ */
slouken@1895
   161
slouken@1895
   162
/* vi: set ts=4 sw=4 expandtab: */