Blender V4.5
bgl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <Python.h>
12
13PyObject *BPyInit_bgl();
14
15/* This API is deprecated, currently these are only used in `bgl.cc`
16 * and there should be no reason to make use of them in the future.
17 * Use a define to indicate they are part of the public API which is being phased out. */
18#ifdef USE_BGL_DEPRECATED_API
19
25struct Buffer {
26 PyObject_VAR_HEAD
27 PyObject *parent;
28
29 int type; /* GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT */
30 int ndimensions;
31 int *dimensions;
32
33 union {
34 char *asbyte;
35 short *asshort;
36 int *asint;
37 float *asfloat;
38 double *asdouble;
39
40 void *asvoid;
41 } buf;
42};
43
45extern PyTypeObject BGL_bufferType;
46
54struct Buffer *BGL_MakeBuffer(int type,
55 int ndimensions,
56 const int *dimensions,
57 const void *initbuffer);
58
59int BGL_typeSize(int type);
60
61#endif /* USE_BGL_DEPRECATED_API */
int BGL_typeSize(int type)
Definition bgl.cc:488
PyTypeObject BGL_bufferType
Definition bgl.cc:644
Buffer * BGL_MakeBuffer(int type, int ndimensions, const int *dimensions, const void *initbuffer)
Definition bgl.cc:712
PyObject * BPyInit_bgl()
Definition bgl.cc:2655