12 #include "../generic/py_capi_utils.h"
20 # pragma warning(push)
21 # pragma warning(disable : 4005)
27 # ifdef WITH_SDL_DYNLOAD
35 {
"supported", (
"Boolean, True when Blender is built with SDL support")},
36 {
"version", (
"The SDL version as a tuple of 3 numbers")},
37 {
"version_string", (
"The SDL version formatted as a string")},
39 (
"Boolean, True when SDL is available. This is False when "
40 "either *supported* is False, or *dynload* is True and "
41 "Blender cannot find the correct library.")},
47 "This module contains information about SDL blender is linked against",
57 bool sdl_available =
false;
58 SDL_version version = {0, 0, 0};
62 if (sdl_info ==
NULL) {
66 #define SetStrItem(str) PyStructSequence_SET_ITEM(sdl_info, pos++, PyUnicode_FromString(str))
68 #define SetObjItem(obj) PyStructSequence_SET_ITEM(sdl_info, pos++, obj)
73 # ifdef WITH_SDL_DYNLOAD
74 if (sdlewInit() == SDLEW_SUCCESS) {
75 SDL_GetVersion(&version);
80 # if SDL_MAJOR_VERSION >= 2
81 SDL_GetVersion(&version);
83 SDL_VERSION(&version);
89 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(...)