Browse Source

python: adapt to Magnum changes.

pull/9/head
Vladimír Vondruš 6 years ago
parent
commit
799629e410
  1. 4
      src/python/magnum/shaders.cpp
  2. 4
      src/python/magnum/test/test_shaders_gl.py

4
src/python/magnum/shaders.cpp

@ -211,7 +211,7 @@ void shaders(py::module& m) {
&Shaders::Phong::setNormalMatrix, "Set normal matrix")
.def_property("projection_matrix", nullptr,
&Shaders::Phong::setProjectionMatrix, "Set projection matrix")
.def_property("light_positions", nullptr, [](Shaders::Phong& self, const std::vector<Vector3>& positions) {
.def_property("light_positions", nullptr, [](Shaders::Phong& self, const std::vector<Vector4>& positions) {
if(positions.size() != self.lightCount()) {
PyErr_Format(PyExc_ValueError, "expected %u items but got %u", self.lightCount(), UnsignedInt(positions.size()));
throw py::error_already_set{};
@ -219,7 +219,7 @@ void shaders(py::module& m) {
self.setLightPositions(positions);
}, "Light positions")
.def_property("light_colors", nullptr, [](Shaders::Phong& self, const std::vector<Color4>& colors) {
.def_property("light_colors", nullptr, [](Shaders::Phong& self, const std::vector<Color3>& colors) {
if(colors.size() != self.lightCount()) {
PyErr_Format(PyExc_ValueError, "expected %u items but got %u", self.lightCount(), UnsignedInt(colors.size()));
throw py::error_already_set{};

4
src/python/magnum/test/test_shaders_gl.py

@ -89,8 +89,8 @@ class Phong(GLTestCase):
a.diffuse_color = (0.5, 1.0, 0.9)
a.transformation_matrix = Matrix4.translation(Vector3.x_axis())
a.projection_matrix = Matrix4.zero_init()
a.light_positions = [(0.5, 1.0, 0.3), Vector3()]
a.light_colors = [Color4(), Color4()]
a.light_positions = [(0.5, 1.0, 0.3, 1.0), Vector4()]
a.light_colors = [Color3(), Color3()]
a.alpha_mask = 0.3
texture = gl.Texture2D()

Loading…
Cancel
Save