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

EGL image buffer with plane descriptors and imported GL textures. More...

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

Public Member Functions

const char * block () const
 Query a uniform block index from an OpenGL program.
 
GLuint handle () const
 Return the native handle owned by the wrapper.
 
void update (const std::string_view &view, std::size_t offset=0)
 Update one uniform member in the block buffer.
 
void update (std::string_view *members, std::size_t count, std::size_t offset=0)
 Update multiple uniform members in the block buffer.
 

Static Public Member Functions

static buffer_t make (util::buffer_t< GLint > &&offsets, const char *block, const std::string_view &data)
 Allocate the underlying object and wrap it in the owning handle.
 

Detailed Description

EGL image buffer with plane descriptors and imported GL textures.

Member Function Documentation

◆ block()

const char * gl::buffer_t::block ( ) const

Query a uniform block index from an OpenGL program.

Returns
Uniform block name associated with the buffer.

◆ handle()

GLuint gl::buffer_t::handle ( ) const

Return the native handle owned by the wrapper.

Returns
OpenGL buffer object name.

◆ make()

buffer_t gl::buffer_t::make ( util::buffer_t< GLint > && offsets,
const char * block,
const std::string_view & data )
static

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

Parameters
offsetsByte offsets for each uniform member in the block.
blockUniform block name used for diagnostics and updates.
dataInitial bytes copied into the uniform buffer.
Returns
Created backend object, or null when creation fails.

◆ update() [1/2]

void gl::buffer_t::update ( const std::string_view & view,
std::size_t offset = 0 )

Update one uniform member in the block buffer.

Parameters
viewRaw bytes to copy into the uniform block.
offsetUniform-member index whose offset is used as the destination.

◆ update() [2/2]

void gl::buffer_t::update ( std::string_view * members,
std::size_t count,
std::size_t offset = 0 )

Update multiple uniform members in the block buffer.

Parameters
membersUniform members to query within the block.
countNumber of members in the array.
offsetFirst uniform-member index to update.

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