chrono::opengl::ChOpenGLShader Class Reference


Sample shader class that loads and compiles the vertex and fragment shaders.

#include <ChOpenGLShader.h>

Inheritance diagram for chrono::opengl::ChOpenGLShader:
Collaboration diagram for chrono::opengl::ChOpenGLShader:

Public Member Functions

void TakeDown ()
void Use ()
bool CompileStrings (std::string shader_name, const char *vertex_shader, const char *fragment_shader)
bool CompileFiles (std::string vertex_shader_file, std::string fragment_shader_file)
void CompleteInit ()
virtual bool InitializeFiles (std::string vertex_shader_file, std::string fragment_shader_file)
virtual bool InitializeStrings (std::string shader_name, const char *vertex_shader_file, const char *fragment_shader_file)
virtual void CustomSetup ()
void CommonSetup (const GLfloat *projection, const GLfloat *view)
void SetTime (const float &_time)
void SetCamera (const glm::vec3 &campos)
void SetViewport (const glm::ivec2 &viewport)
GLuint GetUniformLocation (std::string name)
bool LoadShader (const std::string file_name, GLuint shader_id)
bool LoadShaderString (const char *shader_string, GLuint shader_id)
std::string GetShaderLog (GLuint shader_id)
void CheckGlProgram (GLuint prog)
- Public Member Functions inherited from chrono::opengl::ChOpenGLBase
bool GLReturnedError (const char *s)

Public Attributes

GLuint view_matrix_handle
GLuint projection_matrix_handle
GLuint time_handle
GLuint camera_handle
GLuint viewport_size_handle
GLuint vertex_shader_id
GLuint fragment_shader_id
GLuint program_id
float time
glm::vec3 camera_pos
glm::ivec2 viewport_size