szabolcsdombi / zengl

OpenGL Rendering Pipelines for Python
https://zengl.readthedocs.io/
MIT License
176 stars 10 forks source link

Pipeline vertex_count, first_vertex and instance_count cannot be read or written after creation #8

Closed mrossetti closed 2 years ago

mrossetti commented 2 years ago

In zengl.cpp (currently at line 2124)

PyMemberDef Pipeline_members[] = {
    {"vertex_count", T_OBJECT_EX, offsetof(Pipeline, vertex_count), 0, NULL},
    {"instance_count", T_OBJECT_EX, offsetof(Pipeline, instance_count), 0, NULL},
    {"first_vertex", T_OBJECT_EX, offsetof(Pipeline, first_vertex), 0, NULL},
    {},
};

should use T_INT instead

PyMemberDef Pipeline_members[] = {
    {"vertex_count", T_INT, offsetof(Pipeline, vertex_count), 0, NULL},
    {"instance_count", T_INT, offsetof(Pipeline, instance_count), 0, NULL},
    {"first_vertex", T_INT, offsetof(Pipeline, first_vertex), 0, NULL},
    {},
};
szabolcsdombi commented 2 years ago

Thank you for fixing this in https://github.com/szabolcsdombi/zengl/pull/9 I make a release with this fix