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 338 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 152 of file GLUtil.cc.

◆ Shader() [2/2]

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

Definition at line 157 of file GLUtil.cc.

◆ ~Shader()

gl::Shader::~Shader ( )
protected

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

Referenced by gl::ShaderProgram::attach(), gl::ShaderProgram::getUniformLocation(), and gl::ShaderProgram::link().

Friends And Related Function Documentation

◆ ShaderProgram

friend class ShaderProgram
friend

Definition at line 359 of file GLUtil.hh.


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