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

OpenGL shader object that compiles GLSL source. More...

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

Public Member Functions

std::string err_str ()
 Read the shader compiler log.
 
GLuint handle () const
 Return the native handle owned by the wrapper.
 

Static Public Member Functions

static util::Either< shader_t, std::string > compile (const std::string_view &source, GLenum type)
 Compile an OpenGL shader and report compiler errors.
 

Detailed Description

OpenGL shader object that compiles GLSL source.

Member Function Documentation

◆ compile()

util::Either< shader_t, std::string > gl::shader_t::compile ( const std::string_view & source,
GLenum type )
static

Compile an OpenGL shader and report compiler errors.

Parameters
sourceShader source code to compile.
typeOpenGL shader type, such as GL_VERTEX_SHADER or GL_FRAGMENT_SHADER.
Returns
Compiled shader object, or compiler log on failure.

◆ err_str()

std::string gl::shader_t::err_str ( )

Read the shader compiler log.

Returns
Shader compiler error log.

◆ handle()

GLuint gl::shader_t::handle ( ) const

Return the native handle owned by the wrapper.

Returns
OpenGL shader object name.

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