Now that all relevant code is C++, the indirection from the C struct `GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds complexity and necessitates a wrapper API, making more cleanups like use of RAII or other C++ types more difficult. This commit replaces the C wrapper structs with direct use of the vertex and index buffer base classes. In C++ we can choose which parts of a class are private, so we don't risk exposing too many implementation details here. Pull Request: https://projects.blender.org/blender/blender/pulls/119825
25 lines
455 B
C++
25 lines
455 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup bpygpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace blender::gpu {
|
|
class IndexBuf;
|
|
}
|
|
|
|
extern PyTypeObject BPyGPUIndexBuf_Type;
|
|
|
|
#define BPyGPUIndexBuf_Check(v) (Py_TYPE(v) == &BPyGPUIndexBuf_Type)
|
|
|
|
struct BPyGPUIndexBuf {
|
|
PyObject_VAR_HEAD
|
|
blender::gpu::IndexBuf *elem;
|
|
};
|
|
|
|
PyObject *BPyGPUIndexBuf_CreatePyObject(blender::gpu::IndexBuf *elem);
|