Blender
V4.3
source
blender
python
gpu
gpu_py.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
12
#include <Python.h>
13
14
#include "
GPU_init_exit.hh
"
15
#include "
GPU_primitive.hh
"
16
#include "
GPU_texture.hh
"
17
18
#include "
../generic/py_capi_utils.hh
"
19
20
#include "
gpu_py.hh
"
/* own include */
21
22
/* -------------------------------------------------------------------- */
26
PyC_StringEnumItems
bpygpu_primtype_items
[] = {
27
{
GPU_PRIM_POINTS
,
"POINTS"
},
28
{
GPU_PRIM_LINES
,
"LINES"
},
29
{
GPU_PRIM_TRIS
,
"TRIS"
},
30
{
GPU_PRIM_LINE_STRIP
,
"LINE_STRIP"
},
31
{
GPU_PRIM_LINE_LOOP
,
"LINE_LOOP"
},
32
{
GPU_PRIM_TRI_STRIP
,
"TRI_STRIP"
},
33
{
GPU_PRIM_TRI_FAN
,
"TRI_FAN"
},
34
{
GPU_PRIM_LINES_ADJ
,
"LINES_ADJ"
},
35
{
GPU_PRIM_TRIS_ADJ
,
"TRIS_ADJ"
},
36
{
GPU_PRIM_LINE_STRIP_ADJ
,
"LINE_STRIP_ADJ"
},
37
{0,
nullptr
},
38
};
39
40
PyC_StringEnumItems
bpygpu_dataformat_items
[] = {
41
{
GPU_DATA_FLOAT
,
"FLOAT"
},
42
{
GPU_DATA_INT
,
"INT"
},
43
{
GPU_DATA_UINT
,
"UINT"
},
44
{
GPU_DATA_UBYTE
,
"UBYTE"
},
45
{
GPU_DATA_UINT_24_8
,
"UINT_24_8"
},
46
{
GPU_DATA_10_11_11_REV
,
"10_11_11_REV"
},
47
{0,
nullptr
},
48
};
49
52
/* -------------------------------------------------------------------- */
56
bool
bpygpu_is_init_or_error
()
57
{
58
if
(!
GPU_is_init
()) {
59
PyErr_SetString(PyExc_SystemError,
60
"GPU functions for drawing are not available in background mode"
);
61
62
return
false
;
63
}
64
65
return
true
;
66
}
67
GPU_init_exit.hh
GPU_is_init
bool GPU_is_init()
Definition
gpu_init_exit.cc:55
GPU_primitive.hh
GPU_PRIM_TRI_FAN
@ GPU_PRIM_TRI_FAN
Definition
GPU_primitive.hh:23
GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINE_LOOP
Definition
GPU_primitive.hh:21
GPU_PRIM_LINE_STRIP_ADJ
@ GPU_PRIM_LINE_STRIP_ADJ
Definition
GPU_primitive.hh:29
GPU_PRIM_TRIS_ADJ
@ GPU_PRIM_TRIS_ADJ
Definition
GPU_primitive.hh:28
GPU_PRIM_LINES
@ GPU_PRIM_LINES
Definition
GPU_primitive.hh:18
GPU_PRIM_POINTS
@ GPU_PRIM_POINTS
Definition
GPU_primitive.hh:17
GPU_PRIM_LINES_ADJ
@ GPU_PRIM_LINES_ADJ
Definition
GPU_primitive.hh:27
GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_STRIP
Definition
GPU_primitive.hh:20
GPU_PRIM_TRI_STRIP
@ GPU_PRIM_TRI_STRIP
Definition
GPU_primitive.hh:22
GPU_PRIM_TRIS
@ GPU_PRIM_TRIS
Definition
GPU_primitive.hh:19
GPU_texture.hh
GPU_DATA_UINT_24_8
@ GPU_DATA_UINT_24_8
Definition
GPU_texture.hh:503
GPU_DATA_INT
@ GPU_DATA_INT
Definition
GPU_texture.hh:499
GPU_DATA_10_11_11_REV
@ GPU_DATA_10_11_11_REV
Definition
GPU_texture.hh:505
GPU_DATA_UBYTE
@ GPU_DATA_UBYTE
Definition
GPU_texture.hh:501
GPU_DATA_UINT
@ GPU_DATA_UINT
Definition
GPU_texture.hh:500
GPU_DATA_FLOAT
@ GPU_DATA_FLOAT
Definition
GPU_texture.hh:497
bpygpu_is_init_or_error
bool bpygpu_is_init_or_error()
Definition
gpu_py.cc:56
bpygpu_primtype_items
PyC_StringEnumItems bpygpu_primtype_items[]
Definition
gpu_py.cc:26
bpygpu_dataformat_items
PyC_StringEnumItems bpygpu_dataformat_items[]
Definition
gpu_py.cc:40
gpu_py.hh
py_capi_utils.hh
PyC_StringEnumItems
Definition
py_capi_utils.hh:268
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0