FrameBuffer creation flags replace booleans

Instead of many creation options (with alpha, with multisampling, etc) use a single flag with boolean operators. Creation of the new mipmap flag for FrameBuffer, rendering the current FBO into multiple sub-resolutions.
This commit is contained in:
Bruno Herbelin
2022-05-22 15:14:10 +02:00
parent 7867aac55f
commit d695aa9f57
15 changed files with 151 additions and 77 deletions

View File

@@ -138,12 +138,12 @@ void FrameGrabbing::grabFrame(FrameBuffer *frame_buffer)
// if different frame buffer from previous frame
if ( frame_buffer->width() != width_ ||
frame_buffer->height() != height_ ||
frame_buffer->use_alpha() != use_alpha_) {
(frame_buffer->flags() & FrameBuffer::FrameBuffer_alpha) != use_alpha_) {
// define stream properties
width_ = frame_buffer->width();
height_ = frame_buffer->height();
use_alpha_ = frame_buffer->use_alpha();
use_alpha_ = (frame_buffer->flags() & FrameBuffer::FrameBuffer_alpha);
size_ = width_ * height_ * (use_alpha_ ? 4 : 3);
// first time initialization