Cleanup: Python GPU: Use consistent prefixes for local API
It was not following the own documentation at the top code that mentions that for local API the prefix is "bpygpu_".
This commit is contained in:
@@ -122,16 +122,16 @@ PyObject *BPyInit_gpu(void)
|
||||
|
||||
mod = PyModule_Create(&GPU_module_def);
|
||||
|
||||
PyModule_AddObject(mod, "types", (submodule = BPyInit_gpu_types()));
|
||||
PyModule_AddObject(mod, "types", (submodule = bpygpu_types_init()));
|
||||
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
|
||||
|
||||
PyModule_AddObject(mod, "matrix", (submodule = BPyInit_gpu_matrix()));
|
||||
PyModule_AddObject(mod, "matrix", (submodule = bpygpu_matrix_init()));
|
||||
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
|
||||
|
||||
PyModule_AddObject(mod, "select", (submodule = BPyInit_gpu_select()));
|
||||
PyModule_AddObject(mod, "select", (submodule = bpygpu_select_init()));
|
||||
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
|
||||
|
||||
PyModule_AddObject(mod, "shader", (submodule = BPyInit_gpu_shader()));
|
||||
PyModule_AddObject(mod, "shader", (submodule = bpygpu_shader_init()));
|
||||
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
|
||||
|
||||
return mod;
|
||||
|
@@ -537,18 +537,18 @@ static struct PyMethodDef py_matrix_methods[] = {
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(py_matrix_doc, "This module provides access to the matrix stack.");
|
||||
static PyModuleDef BPyGPU_matrix_module_def = {
|
||||
static PyModuleDef py_matrix_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_name = "gpu.matrix",
|
||||
.m_doc = py_matrix_doc,
|
||||
.m_methods = py_matrix_methods,
|
||||
};
|
||||
|
||||
PyObject *BPyInit_gpu_matrix(void)
|
||||
PyObject *bpygpu_matrix_init(void)
|
||||
{
|
||||
PyObject *submodule;
|
||||
|
||||
submodule = PyModule_Create(&BPyGPU_matrix_module_def);
|
||||
submodule = PyModule_Create(&py_matrix_module_def);
|
||||
|
||||
if (PyType_Ready(&BPyGPU_matrix_stack_context_Type) < 0) {
|
||||
return NULL;
|
||||
|
@@ -20,4 +20,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
PyObject *BPyInit_gpu_matrix(void);
|
||||
PyObject *bpygpu_matrix_init(void);
|
||||
|
@@ -69,18 +69,18 @@ static struct PyMethodDef py_select_methods[] = {
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(py_select_doc, "This module provides access to selection.");
|
||||
static PyModuleDef BPyGPU_select_module_def = {
|
||||
static PyModuleDef py_select_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_name = "gpu.select",
|
||||
.m_doc = py_select_doc,
|
||||
.m_methods = py_select_methods,
|
||||
};
|
||||
|
||||
PyObject *BPyInit_gpu_select(void)
|
||||
PyObject *bpygpu_select_init(void)
|
||||
{
|
||||
PyObject *submodule;
|
||||
|
||||
submodule = PyModule_Create(&BPyGPU_select_module_def);
|
||||
submodule = PyModule_Create(&py_select_module_def);
|
||||
|
||||
return submodule;
|
||||
}
|
||||
|
@@ -20,4 +20,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
PyObject *BPyInit_gpu_select(void);
|
||||
PyObject *bpygpu_select_init(void);
|
||||
|
@@ -736,7 +736,7 @@ PyDoc_STRVAR(py_shader_module_doc,
|
||||
"3D_SMOOTH_COLOR\n"
|
||||
" :Attributes: vec3 pos, vec4 color\n"
|
||||
" :Uniforms: none\n");
|
||||
static PyModuleDef BPyGPU_shader_module_def = {
|
||||
static PyModuleDef py_shader_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_name = "gpu.shader",
|
||||
.m_doc = py_shader_module_doc,
|
||||
@@ -760,11 +760,11 @@ PyObject *BPyGPUShader_CreatePyObject(GPUShader *shader, bool is_builtin)
|
||||
return (PyObject *)self;
|
||||
}
|
||||
|
||||
PyObject *BPyInit_gpu_shader(void)
|
||||
PyObject *bpygpu_shader_init(void)
|
||||
{
|
||||
PyObject *submodule;
|
||||
|
||||
submodule = PyModule_Create(&BPyGPU_shader_module_def);
|
||||
submodule = PyModule_Create(&py_shader_module_def);
|
||||
|
||||
return submodule;
|
||||
}
|
||||
|
@@ -30,4 +30,4 @@ typedef struct BPyGPUShader {
|
||||
} BPyGPUShader;
|
||||
|
||||
PyObject *BPyGPUShader_CreatePyObject(struct GPUShader *shader, bool is_builtin);
|
||||
PyObject *BPyInit_gpu_shader(void);
|
||||
PyObject *bpygpu_shader_init(void);
|
||||
|
@@ -32,16 +32,16 @@
|
||||
/** \name GPU Types Module
|
||||
* \{ */
|
||||
|
||||
static struct PyModuleDef BPyGPU_types_module_def = {
|
||||
static struct PyModuleDef py_types_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_name = "gpu.types",
|
||||
};
|
||||
|
||||
PyObject *BPyInit_gpu_types(void)
|
||||
PyObject *bpygpu_types_init(void)
|
||||
{
|
||||
PyObject *submodule;
|
||||
|
||||
submodule = PyModule_Create(&BPyGPU_types_module_def);
|
||||
submodule = PyModule_Create(&py_types_module_def);
|
||||
|
||||
if (PyType_Ready(&BPyGPUVertFormat_Type) < 0) {
|
||||
return NULL;
|
||||
|
@@ -27,4 +27,4 @@
|
||||
#include "gpu_py_vertex_buffer.h"
|
||||
#include "gpu_py_vertex_format.h"
|
||||
|
||||
PyObject *BPyInit_gpu_types(void);
|
||||
PyObject *bpygpu_types_init(void);
|
||||
|
Reference in New Issue
Block a user