Cleanup: move bgl header to C++

This commit is contained in:
Campbell Barton
2025-01-07 11:12:10 +11:00
parent 6ae599c588
commit 724e4fe937
4 changed files with 20 additions and 28 deletions

View File

@@ -22,7 +22,7 @@ set(SRC
py_capi_rna.cc
py_capi_utils.cc
bgl.h
bgl.hh
bl_math_py_api.hh
blf_py_api.hh
idprop_py_api.hh

View File

@@ -28,7 +28,7 @@
#include <epoxy/gl.h>
#include "bgl.h"
#include "bgl.hh"
#include "CLG_log.h"

View File

@@ -8,32 +8,12 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPyInit_bgl(void);
/**
* Create a buffer object
*
* \param dimensions: An array of ndimensions integers representing the size of each dimension.
* \param initbuffer: When not NULL holds a contiguous buffer
* with the correct format from which the buffer will be initialized
*/
struct _Buffer *BGL_MakeBuffer(int type,
int ndimensions,
const int *dimensions,
const void *initbuffer);
int BGL_typeSize(int type);
/**
* Buffer Object
*
* For Python access to OpenGL functions requiring a pointer.
*/
typedef struct _Buffer {
struct Buffer {
PyObject_VAR_HEAD
PyObject *parent;
@@ -50,11 +30,23 @@ typedef struct _Buffer {
void *asvoid;
} buf;
} Buffer;
};
/** The type object. */
extern PyTypeObject BGL_bufferType;
#ifdef __cplusplus
}
#endif
PyObject *BPyInit_bgl();
/**
* Create a buffer object
*
* \param dimensions: An array of ndimensions integers representing the size of each dimension.
* \param initbuffer: When not NULL holds a contiguous buffer
* with the correct format from which the buffer will be initialized
*/
struct Buffer *BGL_MakeBuffer(int type,
int ndimensions,
const int *dimensions,
const void *initbuffer);
int BGL_typeSize(int type);

View File

@@ -63,7 +63,7 @@
/* `inittab` initialization functions. */
#include "../bmesh/bmesh_py_api.hh"
#include "../generic/bgl.h"
#include "../generic/bgl.hh"
#include "../generic/bl_math_py_api.hh"
#include "../generic/blf_py_api.hh"
#include "../generic/idprop_py_api.hh"