|
|
|
|
@ -35,6 +35,8 @@
|
|
|
|
|
#include <Magnum/GL/AbstractShaderProgram.h> |
|
|
|
|
#include <Magnum/GL/Attribute.h> |
|
|
|
|
#include <Magnum/GL/Buffer.h> |
|
|
|
|
#include <Magnum/GL/BufferTexture.h> |
|
|
|
|
#include <Magnum/GL/BufferTextureFormat.h> |
|
|
|
|
#include <Magnum/GL/Context.h> |
|
|
|
|
#include <Magnum/GL/DefaultFramebuffer.h> |
|
|
|
|
#include <Magnum/GL/Framebuffer.h> |
|
|
|
|
@ -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_<GL::BufferTextureFormat>{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_<GL::RenderbufferFormat>{m, "RenderbufferFormat", "Internal renderbuffer format"} |
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
|
@ -1383,6 +1422,14 @@ void gl(py::module_& m) {
|
|
|
|
|
texture(texture3D); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
py::class_<GL::BufferTexture, GL::AbstractTexture> 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_<GL::Framebuffer, GL::AbstractFramebuffer, GL::PyFramebufferHolder<GL::Framebuffer>> framebuffer{m, |
|
|
|
|
"Framebuffer", "Framebuffer"}; |
|
|
|
|
|