OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Shader Class Reference

#include <shader.h>

Public Member Functions

 Shader ()
 
bool load_from_src (const string *sources, GLenum *types, int count)
 
bool load_from_src (string vs_src, string fs_src)
 
bool load_from_file (const string *paths, GLenum *types, int count)
 
bool load_from_file (string vs_path, string fs_path)
 
bool load_compute_from_file (string cs_path)
 
bool link ()
 
void dispose ()
 
void use ()
 
void unuse ()
 
GLint get_uniform_location (string name)
 
GLint get_attribute_location (string name)
 
void set_attribfv (string name, GLsizei num_components, GLsizei stride, GLsizei offset)
 
void unset_attrib (string name)
 
void set_uniform (string name, const mat4 &v)
 
void set_uniform (string name, const vec4 &v)
 
void set_uniform (string name, const vec3 &v)
 
void set_uniform (string name, const vec2 &v)
 
void set_uniform (string name, double v)
 
void set_uniform (string name, float v)
 
void set_uniform (string name, int v)
 
void set_uniform (string name, unsigned int v)
 
 Shader ()
 
bool load_from_src (const string *sources, GLenum *types, int count)
 
bool load_from_src (string vs_src, string fs_src)
 
bool load_from_file (const string *paths, GLenum *types, int count)
 
bool load_from_file (string vs_path, string fs_path)
 
bool link ()
 
void dispose ()
 
void use ()
 
void unuse ()
 
GLint get_uniform_location (string name)
 
GLint get_attribute_location (string name)
 
void set_attribfv (string name, GLsizei num_components, GLsizei stride, GLsizei offset)
 
void unset_attrib (string name)
 
void set_uniform (string name, const mat4 &v)
 
void set_uniform (string name, const vec4 &v)
 
void set_uniform (string name, const vec3 &v)
 
void set_uniform (string name, const vec2 &v)
 
void set_uniform (string name, double v)
 
void set_uniform (string name, float v)
 
void set_uniform (string name, int v)
 
void set_uniform (string name, unsigned int v)
 

Private Attributes

std::unordered_map< string, GLint > m_attributes
 
std::unordered_map< string, GLint > m_uniforms
 
GLuint m_id
 
std::vector< GLuintm_shaders
 

Detailed Description

Definition at line 27 of file shader.h.

Constructor & Destructor Documentation

Shader::Shader ( )

Definition at line 24 of file shader.cpp.

Shader::Shader ( )

Member Function Documentation

void Shader::dispose ( )
void Shader::dispose ( )

Definition at line 129 of file shader.cpp.

GLint Shader::get_attribute_location ( string  name)
GLint Shader::get_attribute_location ( string  name)

Definition at line 165 of file shader.cpp.

GLint Shader::get_uniform_location ( string  name)
GLint Shader::get_uniform_location ( string  name)

Definition at line 148 of file shader.cpp.

bool Shader::link ( )
bool Shader::link ( )

Definition at line 124 of file shader.cpp.

bool Shader::load_compute_from_file ( string  cs_path)

Definition at line 117 of file shader.cpp.

bool Shader::load_from_file ( const string *  paths,
GLenum types,
int  count 
)

Definition at line 93 of file shader.cpp.

bool Shader::load_from_file ( const string *  paths,
GLenum types,
int  count 
)
bool Shader::load_from_file ( string  vs_path,
string  fs_path 
)

Definition at line 110 of file shader.cpp.

bool Shader::load_from_file ( string  vs_path,
string  fs_path 
)
bool Shader::load_from_src ( const string *  sources,
GLenum types,
int  count 
)
bool Shader::load_from_src ( const string *  sources,
GLenum types,
int  count 
)

Definition at line 72 of file shader.cpp.

bool Shader::load_from_src ( string  vs_src,
string  fs_src 
)

Definition at line 86 of file shader.cpp.

bool Shader::load_from_src ( string  vs_src,
string  fs_src 
)
void Shader::set_attribfv ( string  name,
GLsizei  num_components,
GLsizei  stride,
GLsizei  offset 
)
void Shader::set_attribfv ( string  name,
GLsizei  num_components,
GLsizei  stride,
GLsizei  offset 
)

Definition at line 182 of file shader.cpp.

void Shader::set_uniform ( string  name,
const mat4 v 
)
void Shader::set_uniform ( string  name,
const vec4 v 
)
void Shader::set_uniform ( string  name,
const mat4 v 
)

Definition at line 202 of file shader.cpp.

void Shader::set_uniform ( string  name,
const vec3 v 
)
void Shader::set_uniform ( string  name,
const vec4 v 
)

Definition at line 203 of file shader.cpp.

void Shader::set_uniform ( string  name,
const vec3 v 
)

Definition at line 204 of file shader.cpp.

void Shader::set_uniform ( string  name,
const vec2 v 
)
void Shader::set_uniform ( string  name,
double  v 
)
void Shader::set_uniform ( string  name,
const vec2 v 
)

Definition at line 205 of file shader.cpp.

void Shader::set_uniform ( string  name,
double  v 
)

Definition at line 206 of file shader.cpp.

void Shader::set_uniform ( string  name,
float  v 
)
void Shader::set_uniform ( string  name,
int  v 
)
void Shader::set_uniform ( string  name,
float  v 
)

Definition at line 207 of file shader.cpp.

void Shader::set_uniform ( string  name,
int  v 
)

Definition at line 208 of file shader.cpp.

void Shader::set_uniform ( string  name,
unsigned int  v 
)
void Shader::set_uniform ( string  name,
unsigned int  v 
)

Definition at line 209 of file shader.cpp.

void Shader::unset_attrib ( string  name)
void Shader::unset_attrib ( string  name)

Definition at line 197 of file shader.cpp.

void Shader::unuse ( )
void Shader::unuse ( )

Definition at line 143 of file shader.cpp.

void Shader::use ( )
void Shader::use ( )

Definition at line 138 of file shader.cpp.

Member Data Documentation

std::unordered_map< string, GLint > Shader::m_attributes
private

Definition at line 58 of file shader.h.

GLuint Shader::m_id
private

Definition at line 60 of file shader.h.

std::vector< GLuint > Shader::m_shaders
private

Definition at line 61 of file shader.h.

std::unordered_map< string, GLint > Shader::m_uniforms
private

Definition at line 59 of file shader.h.


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