Blender
V2.93
source
blender
python
gpu
gpu_py.c
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*/
16
24
#include <Python.h>
25
26
#include "
GPU_init_exit.h
"
27
#include "
GPU_primitive.h
"
28
#include "
GPU_texture.h
"
29
30
#include "../generic/py_capi_utils.h"
31
32
#include "
gpu_py.h
"
/* own include */
33
34
/* -------------------------------------------------------------------- */
38
struct
PyC_StringEnumItems
bpygpu_primtype_items
[] = {
39
{
GPU_PRIM_POINTS
,
"POINTS"
},
40
{
GPU_PRIM_LINES
,
"LINES"
},
41
{
GPU_PRIM_TRIS
,
"TRIS"
},
42
{
GPU_PRIM_LINE_STRIP
,
"LINE_STRIP"
},
43
{
GPU_PRIM_LINE_LOOP
,
"LINE_LOOP"
},
44
{
GPU_PRIM_TRI_STRIP
,
"TRI_STRIP"
},
45
{
GPU_PRIM_TRI_FAN
,
"TRI_FAN"
},
46
{
GPU_PRIM_LINES_ADJ
,
"LINES_ADJ"
},
47
{
GPU_PRIM_TRIS_ADJ
,
"TRIS_ADJ"
},
48
{
GPU_PRIM_LINE_STRIP_ADJ
,
"LINE_STRIP_ADJ"
},
49
{0,
NULL
},
50
};
51
52
struct
PyC_StringEnumItems
bpygpu_dataformat_items
[] = {
53
{
GPU_DATA_FLOAT
,
"FLOAT"
},
54
{
GPU_DATA_INT
,
"INT"
},
55
{
GPU_DATA_UINT
,
"UINT"
},
56
{
GPU_DATA_UBYTE
,
"UBYTE"
},
57
{
GPU_DATA_UINT_24_8
,
"UINT_24_8"
},
58
{
GPU_DATA_10_11_11_REV
,
"10_11_11_REV"
},
59
{0,
NULL
},
60
};
63
/* -------------------------------------------------------------------- */
67
bool
bpygpu_is_init_or_error
(
void
)
68
{
69
if
(!
GPU_is_init
()) {
70
PyErr_SetString(PyExc_SystemError,
71
"GPU functions for drawing are not available in background mode"
);
72
73
return
false
;
74
}
75
76
return
true
;
77
}
78
GPU_init_exit.h
GPU_is_init
bool GPU_is_init(void)
Definition:
gpu_init_exit.c:76
GPU_primitive.h
GPU_PRIM_TRI_FAN
@ GPU_PRIM_TRI_FAN
Definition:
GPU_primitive.h:41
GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINE_LOOP
Definition:
GPU_primitive.h:39
GPU_PRIM_LINE_STRIP_ADJ
@ GPU_PRIM_LINE_STRIP_ADJ
Definition:
GPU_primitive.h:45
GPU_PRIM_TRIS_ADJ
@ GPU_PRIM_TRIS_ADJ
Definition:
GPU_primitive.h:44
GPU_PRIM_LINES
@ GPU_PRIM_LINES
Definition:
GPU_primitive.h:36
GPU_PRIM_POINTS
@ GPU_PRIM_POINTS
Definition:
GPU_primitive.h:35
GPU_PRIM_LINES_ADJ
@ GPU_PRIM_LINES_ADJ
Definition:
GPU_primitive.h:43
GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_STRIP
Definition:
GPU_primitive.h:38
GPU_PRIM_TRI_STRIP
@ GPU_PRIM_TRI_STRIP
Definition:
GPU_primitive.h:40
GPU_PRIM_TRIS
@ GPU_PRIM_TRIS
Definition:
GPU_primitive.h:37
GPU_texture.h
GPU_DATA_UINT_24_8
@ GPU_DATA_UINT_24_8
Definition:
GPU_texture.h:176
GPU_DATA_INT
@ GPU_DATA_INT
Definition:
GPU_texture.h:173
GPU_DATA_10_11_11_REV
@ GPU_DATA_10_11_11_REV
Definition:
GPU_texture.h:177
GPU_DATA_UBYTE
@ GPU_DATA_UBYTE
Definition:
GPU_texture.h:175
GPU_DATA_UINT
@ GPU_DATA_UINT
Definition:
GPU_texture.h:174
GPU_DATA_FLOAT
@ GPU_DATA_FLOAT
Definition:
GPU_texture.h:172
NULL
return NULL
Definition:
bmesh_operator_api_inline.h:224
bpygpu_dataformat_items
struct PyC_StringEnumItems bpygpu_dataformat_items[]
Definition:
gpu_py.c:52
bpygpu_primtype_items
struct PyC_StringEnumItems bpygpu_primtype_items[]
Definition:
gpu_py.c:38
bpygpu_is_init_or_error
bool bpygpu_is_init_or_error(void)
Definition:
gpu_py.c:67
gpu_py.h
PyC_StringEnumItems
Definition:
py_capi_utils.h:133
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1