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, const std::string &filename)
 Instantiates a shader. More...
 
 Shader (GLenum type, const std::string &header, const std::string &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 314 of file GLUtil.hh.

Constructor & Destructor Documentation

◆ Shader() [1/2]

gl::Shader::Shader ( GLenum  type,
const std::string &  filename 
)
protected

Instantiates a shader.

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

Definition at line 130 of file GLUtil.cc.

References openmsx::filename.

◆ Shader() [2/2]

gl::Shader::Shader ( GLenum  type,
const std::string &  header,
const std::string &  filename 
)
protected

Definition at line 135 of file GLUtil.cc.

References openmsx::filename.

◆ ~Shader()

gl::Shader::~Shader ( )
protected

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

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

Friends And Related Function Documentation

◆ ShaderProgram

friend class ShaderProgram
friend

Definition at line 335 of file GLUtil.hh.


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