Blender
V3.3
source
blender
python
gpu
gpu_py.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
10
#include <Python.h>
11
12
#include "
GPU_init_exit.h
"
13
#include "
GPU_primitive.h
"
14
#include "
GPU_texture.h
"
15
16
#include "../generic/py_capi_utils.h"
17
18
#include "
gpu_py.h
"
/* own include */
19
20
/* -------------------------------------------------------------------- */
24
struct
PyC_StringEnumItems
bpygpu_primtype_items
[] = {
25
{
GPU_PRIM_POINTS
,
"POINTS"
},
26
{
GPU_PRIM_LINES
,
"LINES"
},
27
{
GPU_PRIM_TRIS
,
"TRIS"
},
28
{
GPU_PRIM_LINE_STRIP
,
"LINE_STRIP"
},
29
{
GPU_PRIM_LINE_LOOP
,
"LINE_LOOP"
},
30
{
GPU_PRIM_TRI_STRIP
,
"TRI_STRIP"
},
31
{
GPU_PRIM_TRI_FAN
,
"TRI_FAN"
},
32
{
GPU_PRIM_LINES_ADJ
,
"LINES_ADJ"
},
33
{
GPU_PRIM_TRIS_ADJ
,
"TRIS_ADJ"
},
34
{
GPU_PRIM_LINE_STRIP_ADJ
,
"LINE_STRIP_ADJ"
},
35
{0,
NULL
},
36
};
37
38
struct
PyC_StringEnumItems
bpygpu_dataformat_items
[] = {
39
{
GPU_DATA_FLOAT
,
"FLOAT"
},
40
{
GPU_DATA_INT
,
"INT"
},
41
{
GPU_DATA_UINT
,
"UINT"
},
42
{
GPU_DATA_UBYTE
,
"UBYTE"
},
43
{
GPU_DATA_UINT_24_8
,
"UINT_24_8"
},
44
{
GPU_DATA_10_11_11_REV
,
"10_11_11_REV"
},
45
{0,
NULL
},
46
};
47
50
/* -------------------------------------------------------------------- */
54
bool
bpygpu_is_init_or_error
(
void
)
55
{
56
if
(!
GPU_is_init
()) {
57
PyErr_SetString(PyExc_SystemError,
58
"GPU functions for drawing are not available in background mode"
);
59
60
return
false
;
61
}
62
63
return
true
;
64
}
65
GPU_init_exit.h
GPU_is_init
bool GPU_is_init(void)
Definition:
gpu_init_exit.c:63
GPU_primitive.h
GPU_PRIM_TRI_FAN
@ GPU_PRIM_TRI_FAN
Definition:
GPU_primitive.h:25
GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINE_LOOP
Definition:
GPU_primitive.h:23
GPU_PRIM_LINE_STRIP_ADJ
@ GPU_PRIM_LINE_STRIP_ADJ
Definition:
GPU_primitive.h:31
GPU_PRIM_TRIS_ADJ
@ GPU_PRIM_TRIS_ADJ
Definition:
GPU_primitive.h:30
GPU_PRIM_LINES
@ GPU_PRIM_LINES
Definition:
GPU_primitive.h:20
GPU_PRIM_POINTS
@ GPU_PRIM_POINTS
Definition:
GPU_primitive.h:19
GPU_PRIM_LINES_ADJ
@ GPU_PRIM_LINES_ADJ
Definition:
GPU_primitive.h:29
GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_STRIP
Definition:
GPU_primitive.h:22
GPU_PRIM_TRI_STRIP
@ GPU_PRIM_TRI_STRIP
Definition:
GPU_primitive.h:24
GPU_PRIM_TRIS
@ GPU_PRIM_TRIS
Definition:
GPU_primitive.h:21
GPU_texture.h
GPU_DATA_UINT_24_8
@ GPU_DATA_UINT_24_8
Definition:
GPU_texture.h:175
GPU_DATA_INT
@ GPU_DATA_INT
Definition:
GPU_texture.h:172
GPU_DATA_10_11_11_REV
@ GPU_DATA_10_11_11_REV
Definition:
GPU_texture.h:176
GPU_DATA_UBYTE
@ GPU_DATA_UBYTE
Definition:
GPU_texture.h:174
GPU_DATA_UINT
@ GPU_DATA_UINT
Definition:
GPU_texture.h:173
GPU_DATA_FLOAT
@ GPU_DATA_FLOAT
Definition:
GPU_texture.h:171
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:205
bpygpu_dataformat_items
struct PyC_StringEnumItems bpygpu_dataformat_items[]
Definition:
gpu_py.c:38
bpygpu_primtype_items
struct PyC_StringEnumItems bpygpu_primtype_items[]
Definition:
gpu_py.c:24
bpygpu_is_init_or_error
bool bpygpu_is_init_or_error(void)
Definition:
gpu_py.c:54
gpu_py.h
PyC_StringEnumItems
Definition:
py_capi_utils.h:199
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1