openMSX
Public Member Functions | Protected Member Functions | Friends | List of all members
gl::Shader Class Reference

Wrapper around an OpenGL shader: a program executed on the GPU. More...

#include <GLUtil.hh>

Inheritance diagram for gl::Shader:
Inheritance graph
[legend]

Public Member Functions

 Shader (const Shader &)=delete
 
 Shader (Shader &&)=delete
 
Shaderoperator= (const Shader &)=delete
 
Shaderoperator= (Shader &&)=delete
 
bool isOK () const
 Returns true iff this shader is loaded and compiled without errors.
 

Protected Member Functions

 Shader (GLenum type, std::string_view filename)
 Instantiates a shader.
 
 Shader (GLenum type, std::string_view header, std::string_view filename)
 
 ~Shader ()
 

Friends

class ShaderProgram
 

Detailed Description

Wrapper around an OpenGL shader: a program executed on the GPU.

This class is a base class for vertex and fragment shaders.

Definition at line 294 of file GLUtil.hh.

Constructor & Destructor Documentation

◆ Shader() [1/4]

gl::Shader::Shader ( const Shader )
delete

◆ Shader() [2/4]

gl::Shader::Shader ( Shader &&  )
delete

◆ Shader() [3/4]

gl::Shader::Shader ( GLenum  type,
std::string_view  filename 
)
inlineprotected

Instantiates a shader.

Parameters
typeThe shader type: GL_VERTEX_SHADER or GL_FRAGMENT_SHADER.
filenameThe GLSL source code for the shader.

Definition at line 311 of file GLUtil.hh.

◆ Shader() [4/4]

gl::Shader::Shader ( GLenum  type,
std::string_view  header,
std::string_view  filename 
)
inlineprotected

Definition at line 314 of file GLUtil.hh.

◆ ~Shader()

gl::Shader::~Shader ( )
protected

Definition at line 196 of file GLUtil.cc.

Member Function Documentation

◆ isOK()

bool gl::Shader::isOK ( ) const

Returns true iff this shader is loaded and compiled without errors.

Definition at line 201 of file GLUtil.cc.

Referenced by gl::ShaderProgram::attach().

◆ operator=() [1/2]

Shader & gl::Shader::operator= ( const Shader )
delete

◆ operator=() [2/2]

Shader & gl::Shader::operator= ( Shader &&  )
delete

Friends And Related Symbol Documentation

◆ ShaderProgram

friend class ShaderProgram
friend

Definition at line 323 of file GLUtil.hh.


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