diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 5fb205c..eeec13c 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -792,6 +794,43 @@ void gl(py::module_& m) { }, "Set buffer data", py::arg("data"), py::arg("usage") = GL::BufferUsage::StaticDraw) /** @todo more */; + py::enum_{m, "BufferTextureFormat", "Buffer texture internal format"} + .value("R8", GL::BufferTextureFormat::R8) + .value("RG8", GL::BufferTextureFormat::RG8) + .value("RGBA8", GL::BufferTextureFormat::RGBA8) + #ifndef MAGNUM_TARGET_GLES + .value("R16", GL::BufferTextureFormat::R16) + .value("RG16", GL::BufferTextureFormat::RG16) + .value("RGBA16", GL::BufferTextureFormat::RGBA16) + #endif + .value("R8UI", GL::BufferTextureFormat::R8UI) + .value("RG8UI", GL::BufferTextureFormat::RG8UI) + .value("RGBA8UI", GL::BufferTextureFormat::RGBA8UI) + .value("R8I", GL::BufferTextureFormat::R8I) + .value("RG8I", GL::BufferTextureFormat::RG8I) + .value("RGBA8I", GL::BufferTextureFormat::RGBA8I) + .value("R16UI", GL::BufferTextureFormat::R16UI) + .value("RG16UI", GL::BufferTextureFormat::RG16UI) + .value("RGBA16UI", GL::BufferTextureFormat::RGBA16UI) + .value("R16I", GL::BufferTextureFormat::R16I) + .value("RG16I", GL::BufferTextureFormat::RG16I) + .value("RGBA16I", GL::BufferTextureFormat::RGBA16I) + .value("R32UI", GL::BufferTextureFormat::R32UI) + .value("RG32UI", GL::BufferTextureFormat::RG32UI) + .value("RGB32UI", GL::BufferTextureFormat::RGB32UI) + .value("RGBA32UI", GL::BufferTextureFormat::RGBA32UI) + .value("R32I", GL::BufferTextureFormat::R32I) + .value("RG32I", GL::BufferTextureFormat::RG32I) + .value("RGB32I", GL::BufferTextureFormat::RGB32I) + .value("RGBA32I", GL::BufferTextureFormat::RGBA32I) + .value("R16F", GL::BufferTextureFormat::R16F) + .value("RG16F", GL::BufferTextureFormat::RG16F) + .value("RGBA16F", GL::BufferTextureFormat::RGBA16F) + .value("R32F", GL::BufferTextureFormat::R32F) + .value("RG32F", GL::BufferTextureFormat::RG32F) + .value("RGB32F", GL::BufferTextureFormat::RGB32F) + .value("RGBA32F", GL::BufferTextureFormat::RGBA32F); + /* Renderbuffer */ py::enum_{m, "RenderbufferFormat", "Internal renderbuffer format"} #ifndef MAGNUM_TARGET_GLES @@ -1383,6 +1422,14 @@ void gl(py::module_& m) { texture(texture3D); #endif + py::class_ bufferTexture{m, "BufferTexture", "Buffer texture"}; + bufferTexture + .def(py::init(), "Constructor") + .def("set_buffer", [](GL::BufferTexture& self, GL::BufferTextureFormat internal_format, GL::Buffer& buffer) { + self.setBuffer(internal_format, buffer); + }, "Set buffer texture data", py::arg("internal_format"), py::arg("buffer")) + .def("reset_buffer", &GL::BufferTexture::resetBuffer, "Reset buffer texture data"); + /* Framebuffer, needs to be after textures due to attach_texture() */ py::class_> framebuffer{m, "Framebuffer", "Framebuffer"};