comparison include/SDL_version.h @ 1662:782fd950bd46 SDL-1.3

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.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 0a53c90a37f9
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* This header defines the current SDL version */ 23 /**
24 * \file SDL_version.h
25 *
26 * This header defines the current SDL version
27 */
24 28
25 #ifndef _SDL_version_h 29 #ifndef _SDL_version_h
26 #define _SDL_version_h 30 #define _SDL_version_h
27 31
28 #include "SDL_stdinc.h" 32 #include "SDL_stdinc.h"
29 33
30 #include "begin_code.h" 34 #include "begin_code.h"
31 /* Set up for C function definitions, even when using C++ */ 35 /* Set up for C function definitions, even when using C++ */
32 #ifdef __cplusplus 36 #ifdef __cplusplus
37 /* *INDENT-OFF* */
33 extern "C" { 38 extern "C" {
39 /* *INDENT-ON* */
34 #endif 40 #endif
41
42 /**
43 * \struct SDL_version
44 * \brief Information the version of SDL in use.
45 *
46 * Represents the library's version as three levels: major revision
47 * (increments with massive changes, additions, and enhancements),
48 * minor revision (increments with backwards-compatible changes to the
49 * major revision), and patchlevel (increments with fixes to the minor
50 * revision).
51 *
52 * \sa SDL_VERSION
53 * \sa SDL_GetVersion
54 */
55 typedef struct SDL_version
56 {
57 Uint8 major; /**< major version */
58 Uint8 minor; /**< minor version */
59 Uint8 patch; /**< update version */
60 } SDL_version;
35 61
36 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 62 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
37 */ 63 */
38 #define SDL_MAJOR_VERSION 1 64 #define SDL_MAJOR_VERSION 1
39 #define SDL_MINOR_VERSION 3 65 #define SDL_MINOR_VERSION 3
40 #define SDL_PATCHLEVEL 0 66 #define SDL_PATCHLEVEL 0
41 67
42 typedef struct SDL_version { 68 /**
43 Uint8 major; 69 * \def SDL_VERSION(x)
44 Uint8 minor; 70 * \brief Macro to determine SDL version program was compiled against.
45 Uint8 patch; 71 *
46 } SDL_version; 72 * This macro fills in a SDL_version structure with the version of the
47 73 * library you compiled against. This is determined by what header the
48 /* This macro can be used to fill a version structure with the compile-time 74 * compiler uses. Note that if you dynamically linked the library, you might
49 * version of the SDL library. 75 * have a slightly newer or older version at runtime. That version can be
76 * determined with SDL_GetVersion(), which, unlike SDL_VERSION,
77 * is not a macro.
78 *
79 * \param x A pointer to a SDL_version struct to initialize.
80 *
81 * \sa SDL_version
82 * \sa SDL_GetVersion
50 */ 83 */
51 #define SDL_VERSION(X) \ 84 #define SDL_VERSION(x) \
52 { \ 85 { \
53 (X)->major = SDL_MAJOR_VERSION; \ 86 (x)->major = SDL_MAJOR_VERSION; \
54 (X)->minor = SDL_MINOR_VERSION; \ 87 (x)->minor = SDL_MINOR_VERSION; \
55 (X)->patch = SDL_PATCHLEVEL; \ 88 (x)->patch = SDL_PATCHLEVEL; \
56 } 89 }
57 90
58 /* This macro turns the version numbers into a numeric value: 91 /* This macro turns the version numbers into a numeric value:
59 (1,2,3) -> (1203) 92 (1,2,3) -> (1203)
60 This assumes that there will never be more than 100 patchlevels 93 This assumes that there will never be more than 100 patchlevels
68 101
69 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ 102 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
70 #define SDL_VERSION_ATLEAST(X, Y, Z) \ 103 #define SDL_VERSION_ATLEAST(X, Y, Z) \
71 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 104 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
72 105
73 /* This function gets the version of the dynamically linked SDL library. 106 /**
74 it should NOT be used to fill a version structure, instead you should 107 * \fn void SDL_GetVersion(SDL_version *ver)
75 use the SDL_Version() macro. 108 * \brief Get the version of SDL that is linked against your program.
109 *
110 * If you are using a shared library (DLL) version of SDL, then it is
111 * possible that it will be different than the version you compiled against.
112 *
113 * This is a real function; the macro SDL_VERSION tells you what version
114 * of SDL you compiled against:
115 *
116 * \code
117 * SDL_version compiled;
118 * SDL_version linked;
119 *
120 * SDL_VERSION(&compiled);
121 * SDL_GetVersion(&linked);
122 * printf("We compiled against SDL version %d.%d.%d ...\n",
123 * compiled.major, compiled.minor, compiled.patch);
124 * printf("But we linked against SDL version %d.%d.%d.\n",
125 * linked.major, linked.minor, linked.patch);
126 * \endcode
127 *
128 * This function may be called safely at any time, even before SDL_Init().
129 *
130 * \sa SDL_VERSION
76 */ 131 */
77 extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); 132 extern DECLSPEC void SDLCALL SDL_GetVersion (SDL_version * ver);
78 133
79 /* Ends C function definitions when using C++ */ 134 /* Ends C function definitions when using C++ */
80 #ifdef __cplusplus 135 #ifdef __cplusplus
136 /* *INDENT-OFF* */
81 } 137 }
138 /* *INDENT-ON* */
82 #endif 139 #endif
83 #include "close_code.h" 140 #include "close_code.h"
84 141
85 #endif /* _SDL_version_h */ 142 #endif /* _SDL_version_h */
143
144 /* vi: set ts=4 sw=4 expandtab: */