33 GLint infologLength = 0;
34 GLint charsWritten = 0;
41 infoLog =
new char[infologLength];
44 std::cerr<<infoLog<<std::endl;
76 std::cerr<<
"removing shader "<<
m_name<<
"\n";
84 std::cerr<<
"Warning no shader source loaded\n";
91 GLint infologLength = 0;
92 std::cerr <<
"Compiling Shader "<<
m_name<<
"\n";
96 std::cerr<<
"Shader compile failed or had warnings \n";
110 std::cerr<<
"deleting existing source code\n";
113 std::ifstream shaderSource(_name.c_str());
114 if (!shaderSource.is_open())
116 std::cerr<<
"File not found "<<_name.c_str()<<
"\n";
120 m_source =
std::string((std::istreambuf_iterator<char>(shaderSource)), std::istreambuf_iterator<char>());
121 shaderSource.close();
139 std::cerr<<
"deleting existing source code\n";
Shader(std::string _name, ShaderType _type) noexcept
ctor
bool m_debugState
flag to indicate the debug state
#define GL_TESS_EVALUATION_SHADER
#define GL_GEOMETRY_SHADER
~Shader()
dtor, will clean up shader source and remove shader from GL
GLint GLenum GLsizei GLint GLsizei const void * data
GLsizei GLsizei GLchar * infoLog
implementation files for RibExport class
void loadFromString(const std::string &_string) noexcept
#define GL_COMPUTE_SHADER
#define glGetShaderInfoLog
std::string m_source
the actual source code for this shader (used for debug and initial loading)
#define GL_COMPILE_STATUS
#define GL_FRAGMENT_SHADER
std::string m_name
the text name of this Shader used in the search for shader
GLuint m_shaderHandle
the GL handle for this shader object used in linking etc
void compile() noexcept
compile the current shader will check to see if source is attached and issue warning if not ...
void printInfoLog(const GLuint &_obj)
#define GL_TESS_CONTROL_SHADER
#define GL_INFO_LOG_LENGTH
bool m_compiled
flag to indicate if the shader has been compiled this will get channged on re-load of source to false...
GLsizei const GLchar *const * string
void load(std::string _name) noexcept
load in shader source and attach it to the shader object if source is already loaded it will re-load ...