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

bool isOK () const
 Returns true iff this shader is loaded and compiled without errors. More...
 

Protected Member Functions

 Shader (GLenum type, std::string_view filename)
 Instantiates a shader. More...
 
 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 322 of file GLUtil.hh.

Constructor & Destructor Documentation

◆ Shader() [1/2]

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 334 of file GLUtil.hh.

◆ Shader() [2/2]

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

Definition at line 337 of file GLUtil.hh.

◆ ~Shader()

gl::Shader::~Shader ( )
protected

Definition at line 182 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 187 of file GLUtil.cc.

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

Friends And Related Function Documentation

◆ ShaderProgram

friend class ShaderProgram
friend

Definition at line 347 of file GLUtil.hh.


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