26 #include "../generic/py_capi_utils.h"
34 # pragma warning(push)
35 # pragma warning(disable : 4005)
41 # ifdef WITH_SDL_DYNLOAD
49 {
"supported", (
"Boolean, True when Blender is built with SDL support")},
50 {
"version", (
"The SDL version as a tuple of 3 numbers")},
51 {
"version_string", (
"The SDL version formatted as a string")},
53 (
"Boolean, True when SDL is available. This is False when "
54 "either *supported* is False, or *dynload* is True and "
55 "Blender cannot find the correct library.")},
61 "This module contains information about SDL blender is linked against",
71 bool sdl_available =
false;
72 SDL_version version = {0, 0, 0};
76 if (sdl_info ==
NULL) {
80 #define SetStrItem(str) PyStructSequence_SET_ITEM(sdl_info, pos++, PyUnicode_FromString(str))
82 #define SetObjItem(obj) PyStructSequence_SET_ITEM(sdl_info, pos++, obj)
87 # ifdef WITH_SDL_DYNLOAD
88 if (sdlewInit() == SDLEW_SUCCESS) {
89 SDL_GetVersion(&version);
94 # if SDL_MAJOR_VERSION >= 2
95 SDL_GetVersion(&version);
97 SDL_VERSION(&version);
103 SetObjItem(PyUnicode_FromFormat(
"%d.%d.%d", version.major, version.minor, version.patch));
static PyStructSequence_Desc app_sdl_info_desc
static PyStructSequence_Field app_sdl_info_fields[]
static PyTypeObject BlenderAppSDLType
PyObject * BPY_app_sdl_struct(void)
static PyObject * make_sdl_info(void)
#define PyC_Tuple_Pack_I32(...)