SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_version.h
1#ifndef SDL3PP_VERSION_H_
2#define SDL3PP_VERSION_H_
3
4#include <SDL3/SDL_version.h>
5
6namespace SDL {
7
17#ifdef SDL3PP_DOC
18
26#define SDL_MAJOR_VERSION
27
35#define SDL_MINOR_VERSION
36
44#define SDL_MICRO_VERSION
45
57#define SDL_VERSIONNUM(major, minor, patch) \
58 ((major) * 1000000 + (minor) * 1000 + (patch))
59
71#define SDL_VERSIONNUM_MAJOR(version) ((version) / 1000000)
72
84#define SDL_VERSIONNUM_MINOR(version) (((version) / 1000) % 1000)
85
97#define SDL_VERSIONNUM_MICRO(version) ((version) % 1000)
98
108#define SDL_VERSION \
109 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION)
110
118#define SDL_VERSION_ATLEAST(X, Y, Z) (SDL_VERSION >= SDL_VERSIONNUM(X, Y, Z))
119
120#endif // SDL3PP_DOC
121
140inline int GetVersion() { return SDL_GetVersion(); }
141
168inline const char* GetRevision() { return SDL_GetRevision(); }
169
171#define SDL3PP_MAJOR_VERSION 0
172
174#define SDL3PP_MINOR_VERSION 8
175
177#define SDL3PP_PATCH_VERSION 1
178
180#define SDL3PP_VERSION \
181 SDL_VERSIONNUM( \
182 SDL3PP_MAJOR_VERSION, SDL3PP_MINOR_VERSION, SDL3PP_MICRO_VERSION)
183
185
186// Check if SDL_image is available
187#if !defined(SDL3PP_DISABLE_IMAGE) && !defined(SDL3PP_ENABLE_IMAGE) && \
188 __has_include(<SDL3_image/SDL_image.h>)
189#define SDL3PP_ENABLE_IMAGE
190#endif
191
192// Check if SDL_mixer is available
193#if !defined(SDL3PP_DISABLE_MIXER) && !defined(SDL3PP_ENABLE_MIXER) && \
194 __has_include(<SDL3_mixer/SDL_mixer.h>)
195#define SDL3PP_ENABLE_MIXER
196#endif
197
198// Check if SDL_ttf is available
199#if !defined(SDL3PP_DISABLE_TTF) && !defined(SDL3PP_ENABLE_TTF) && \
200 __has_include(<SDL3_ttf/SDL_ttf.h>)
201#define SDL3PP_ENABLE_TTF
202#endif
203
204} // namespace SDL
205
206#endif /* SDL3PP_VERSION_H_ */
int GetVersion()
Get the version of SDL that is linked against your program.
Definition: SDL3pp_version.h:140
const char * GetRevision()
Get the code revision of the SDL library that is linked against your program.
Definition: SDL3pp_version.h:168
Main include header for the SDL3pp library.