Skip to content

raisin::ScopedPixelUnpackBufferZero ​

class · #include <rayrai/GlStateGuard.hpp>

Binds GL_PIXEL_UNPACK_BUFFER to 0 for the guard's lifetime, restoring the previous binding on destruction. Use around glTexImage*‍/glTexSubImage* calls (including allocations with a null data pointer): while a pixel-unpack buffer is bound, the data pointer is reinterpreted as an offset into that buffer, which can raise GL_INVALID_OPERATION and leave the texture — and any framebuffer it is attached to — incomplete if an earlier pass left one bound.

Constructors & destructor ​

ScopedPixelUnpackBufferZero ​

cpp
ScopedPixelUnpackBufferZero()

~ScopedPixelUnpackBufferZero ​

cpp
~ScopedPixelUnpackBufferZero()

RaiSim — physics for robotics and AI.