Allolib  1.0
C++ Components For Interactive Multimedia
al::Shader Class Reference

Shader object. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/graphics/al_Shader.hpp>

Inheritance diagram for al::Shader:
al::ShaderBase al::GPUObject

Public Types

enum  Type { VERTEX , GEOMETRY , FRAGMENT }
 

Public Member Functions

 Shader (const std::string &source="", Shader::Type type=FRAGMENT)
 
virtual ~Shader ()
 
Shadersource (const std::string &v)
 
Shadersource (const std::string &v, Shader::Type type)
 
Shadercompile ()
 
bool compiled () const
 
Shader::Type type () const
 
const char * log () const
 Returns info log or 0 if none.
 
void printLog () const
 Prints info log, if any.
 
bool created () const
 Returns whether object has been created.
 
void create ()
 Creates object on GPU.
 
void destroy ()
 Destroys object on GPU.
 
unsigned long id () const
 Returns the assigned object id.
 
void id (unsigned long v)
 
void validate ()
 Ensure that the GPUObject is ready to use. More...
 
void invalidate ()
 Triggers re-creation of object safely.
 

Protected Attributes

unsigned int mID
 
bool mResubmit
 

Detailed Description

Shader object.

A shader object represents your source code. You are able to pass your source code to a shader object and compile the shader object.

Definition at line 83 of file al_Shader.hpp.

Constructor & Destructor Documentation

◆ ~Shader()

virtual al::Shader::~Shader ( )
inlinevirtual

This will automatically delete the shader object when it is no longer attached to any program object.

Definition at line 91 of file al_Shader.hpp.

Member Function Documentation

◆ validate()

void al::GPUObject::validate ( )
inherited

Ensure that the GPUObject is ready to use.

This is typically placed before any rendering implementation. If the object has been invalidated, the object will be destroyed and then created again. Otherwise, the object will simply be created if not already created.


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