Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Shader Struct Reference

#include <shader.hpp>

Public Member Functions

 Shader ()
 
 ~Shader ()
 
void fixdetailshader (bool force=true, bool recurse=true)
 
void allocparams (Slot *slot=nullptr)
 
void setslotparams (Slot &slot)
 
void setslotparams (Slot &slot, VSlot &vslot)
 
void bindprograms ()
 
void flushparams (Slot *slot=nullptr)
 
void force ()
 
bool invalid () const
 
bool deferred () const
 
bool loaded () const
 
bool isnull () const
 
int numvariants (int row) const
 
Shadergetvariant (int col, int row) const
 
bool hasoption (int row)
 
void addvariant (int row, Shader *s)
 
void setvariant_ (int col, int row, Shader *fallbackshader)
 
void setvariant (int col, int row, Shader *fallbackshader)
 
void setvariant (int col, int row)
 
void setvariant (int col, int row, Slot &slot, VSlot &vslot, Shader *fallbackshader)
 
void setvariant (int col, int row, Slot &slot, VSlot &vslot)
 
void set_ ()
 
void set ()
 
void set (Slot &slot, VSlot &vslot)
 
bool compile ()
 
void cleanup (bool invalid=false)
 

Static Public Member Functions

static bool isnull (const Shader *s)
 
static int uniformlocversion ()
 

Public Attributes

char * name
 
char * vsstr
 
char * psstr
 
char * defer
 
int type
 
GLuint program
 
GLuint vsobj
 
GLuint psobj
 
vector< SlotShaderParamStatedefaultparams
 
vector< GlobalShaderParamUseglobalparams
 
vector< LocalShaderParamStatelocalparams
 
vector< ucharlocalparamremap
 
Shaderdetailshader
 
Shadervariantshader
 
Shaderaltshader
 
Shaderfastshader [MAXSHADERDETAIL]
 
vector< Shader * > variants
 
ushortvariantrows
 
bool standard
 
bool forced
 
bool used
 
Shaderreusevs
 
Shaderreuseps
 
vector< UniformLocuniformlocs
 
vector< AttribLocattriblocs
 
const voidowner
 

Static Public Attributes

static Shaderlastshader = nullptr
 

Constructor & Destructor Documentation

Shader::Shader ( )
inline

References fastshader, loopi(), and MAXSHADERDETAIL.

Shader::~Shader ( )
inline

References defer, DELETEA, name, psstr, variantrows, and vsstr.

Member Function Documentation

void Shader::addvariant ( int  row,
Shader s 
)
inline
void Shader::allocparams ( Slot slot = nullptr)
void Shader::bindprograms ( )

References glUseProgram_, SHADER_DEFERRED, and SHADER_INVALID.

Referenced by set_(), and setvariant_().

void Shader::cleanup ( bool  invalid = false)
bool Shader::compile ( )
bool Shader::deferred ( ) const
inline

References SHADER_DEFERRED, and type.

Referenced by fixdetailshader().

void Shader::fixdetailshader ( bool  force = true,
bool  recurse = true 
)
void Shader::flushparams ( Slot slot = nullptr)
inline
void Shader::force ( )
Shader* Shader::getvariant ( int  col,
int  row 
) const
inline
bool Shader::hasoption ( int  row)
inline

References detailshader, getvariant(), SHADER_OPTION, and type.

Referenced by changeshader().

bool Shader::invalid ( ) const
inline

References SHADER_INVALID, and type.

Referenced by defershader(), fixdetailshader(), and reloadshaders().

static bool Shader::isnull ( const Shader s)
inlinestatic
bool Shader::isnull ( ) const
inline

References isnull().

Referenced by isnull(), set(), and setvariant().

bool Shader::loaded ( ) const
inline

References detailshader.

Referenced by lookupshaderbyname(), set(), and setvariant().

int Shader::numvariants ( int  row) const
inline

References MAXVARIANTROWS, and variantrows.

Referenced by gengenericvariant(), and variantshader().

void Shader::set ( )
inline
void Shader::set ( Slot slot,
VSlot vslot 
)
inline
void Shader::set_ ( )
inline

References bindprograms(), detailshader, and lastshader.

Referenced by set().

void Shader::setslotparams ( Slot slot)

References Slot::params, SETDEFAULTPARAMS, and SETSLOTPARAMS.

Referenced by set(), and setvariant().

void Shader::setslotparams ( Slot slot,
VSlot vslot 
)
void Shader::setvariant ( int  col,
int  row,
Shader fallbackshader 
)
inline
void Shader::setvariant ( int  col,
int  row 
)
inline
void Shader::setvariant ( int  col,
int  row,
Slot slot,
VSlot vslot,
Shader fallbackshader 
)
inline
void Shader::setvariant ( int  col,
int  row,
Slot slot,
VSlot vslot 
)
inline
void Shader::setvariant_ ( int  col,
int  row,
Shader fallbackshader 
)
inline
int Shader::uniformlocversion ( )
static

Member Data Documentation

Shader * Shader::altshader

Referenced by altshader(), and fixdetailshader().

vector<AttribLoc> Shader::attriblocs
vector<SlotShaderParamState> Shader::defaultparams
char * Shader::defer

Referenced by defershader(), newshader(), and ~Shader().

Shader* Shader::detailshader
Shader * Shader::fastshader[MAXSHADERDETAIL]

Referenced by fastshader(), fixdetailshader(), and Shader().

bool Shader::forced

Referenced by newshader(), and useshaderbyname().

vector<GlobalShaderParamUse> Shader::globalparams
Shader * Shader::lastshader = nullptr
static
vector<uchar> Shader::localparamremap
vector<LocalShaderParamState> Shader::localparams
char* Shader::name
const void* Shader::owner
GLuint Shader::program
GLuint Shader::psobj

Referenced by linkglslprogram().

char * Shader::psstr

Referenced by newshader(), and ~Shader().

Shader * Shader::reuseps

Referenced by newshader(), and reloadshaders().

Shader* Shader::reusevs

Referenced by newshader(), and reloadshaders().

bool Shader::standard
int Shader::type
vector<UniformLoc> Shader::uniformlocs
bool Shader::used

Referenced by flushparams().

ushort* Shader::variantrows
vector<Shader *> Shader::variants
Shader * Shader::variantshader

Referenced by newshader().

GLuint Shader::vsobj

Referenced by linkglslprogram().

char * Shader::vsstr

Referenced by newshader(), and ~Shader().


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