Sunshine master
Self-hosted game stream host for Moonlight.
gl::frame_buf_t Class Reference

OpenGL framebuffer handle wrapper. More...

#include <src/platform/linux/graphics.h>

Inheritance diagram for gl::frame_buf_t:
[legend]
Collaboration diagram for gl::frame_buf_t:
[legend]

Public Member Functions

template<class It >
void bind (It it_begin, It it_end)
 Bind textures to this object's framebuffers as color attachments.
 
void bind (std::nullptr_t, std::nullptr_t)
 Bind each framebuffer and clear its color attachment.
 
void copy (int id, int texture, int offset_x, int offset_y, int width, int height)
 
 frame_buf_t (frame_buf_t &&)=default
 Move ownership of OpenGL framebuffer object names.
 
frame_buf_toperator= (frame_buf_t &&)=default
 Assign state from another instance while preserving ownership semantics.
 
- Public Member Functions inherited from util::buffer_t< GLuint >
GLuint * begin ()
 Return an iterator to the first byte in the buffer view.
 
const GLuint * begin () const
 Return an iterator to the first byte in the buffer view.
 
 buffer_t (buffer_t &&o) noexcept
 Construct an owning contiguous buffer.
 
 buffer_t (const buffer_t &o)
 Construct an owning contiguous buffer.
 
 buffer_t (size_t elements)
 Construct an owning contiguous buffer.
 
 buffer_t (size_t elements, const GLuint &t)
 Construct an owning contiguous buffer.
 
GLuint * end ()
 Return an iterator one past the final byte in the buffer view.
 
const GLuint * end () const
 Return an iterator one past the final byte in the buffer view.
 
void fake_resize (std::size_t els)
 Update the logical element count without reallocating storage.
 
buffer_toperator= (buffer_t &&o) noexcept
 Assign state from another instance while preserving ownership semantics.
 
GLuint & operator[] (size_t el)
 Access an element in the owning buffer.
 
const GLuint & operator[] (size_t el) const
 Access an element in the owning buffer.
 
size_t size () const
 Return the serialized size of the current object.
 

Static Public Member Functions

static frame_buf_t make (std::size_t count)
 Allocate the underlying object and wrap it in the owning handle.
 

Detailed Description

OpenGL framebuffer handle wrapper.

Member Function Documentation

◆ bind()

template<class It >
void gl::frame_buf_t::bind ( It it_begin,
It it_end )
inline

Bind textures to this object's framebuffers as color attachments.

Parameters
it_beginFirst texture object to attach.
it_endOne-past-the-end iterator for texture objects to attach.

◆ copy()

void gl::frame_buf_t::copy ( int id,
int texture,
int offset_x,
int offset_y,
int width,
int height )

Copies a part of the framebuffer to texture

Parameters
idFramebuffer index to copy from.
textureDestination texture receiving the copied pixels.
offset_xSource X offset in pixels.
offset_ySource Y offset in pixels.
widthFrame or display width in pixels.
heightFrame or display height in pixels.

◆ make()

frame_buf_t gl::frame_buf_t::make ( std::size_t count)
static

Allocate the underlying object and wrap it in the owning handle.

Parameters
countNumber of objects or handles to create.
Returns
Created backend object, or null when creation fails.

◆ operator=()

frame_buf_t & gl::frame_buf_t::operator= ( frame_buf_t && )
default

Assign state from another instance while preserving ownership semantics.

Returns
Reference or value produced by the operator.

The documentation for this class was generated from the following files: