68 #ifndef __gVirtualXRayConfig_h 130 void loadFiles(
const std::string& aVertexShaderFilename,
131 const std::string& aFragmentShaderFilename);
140 void loadFile(
const std::string& aComputeShaderFilename);
150 void setLabels(
const std::string& aVertexShaderLabel,
151 const std::string& aFragmentShaderLabel);
160 void setLabel(
const std::string& aComputeShaderLabel);
197 void loadSource(
const std::string& aVertexShaderSourceCode,
198 const std::string& aFragmentShaderSourceCode);
207 void loadSource(
const std::string& aComputeShaderSourceCode);
265 int loadFile(
const std::string& aShaderFilename,
char**& aShaderSource);
280 char** aShaderSource);
void loadFiles(const std::string &aVertexShaderFilename, const std::string &aFragmentShaderFilename)
Load the vertex and fragment shaders from files.
void releaseComputeSourceMemory()
Release the memory held by the compute shader.
void releaseFragmentSourceMemory()
Release the memory held by the fragment shader.
unsigned int m_vertex_shader_id
ID of the vertex shader.
void loadVertexShaderFile(const std::string &aVertexShaderFilename)
Load the vertex shader from a file.
void loadFile(const std::string &aComputeShaderFilename)
Load the compute shader from a file.
unsigned int m_shader_program_id
ID of the shader program.
std::string m_vertex_shader_filename
Name of the file containing the vertex shader.
static void disable()
Disable the current shader (if any)
void loadFragmentShaderSource(const std::string &aFragmentShaderSourceCode)
Load the fragment shader from a string.
std::string m_compute_shader_filename
Name of the file containing the compute shader.
void loadFragmentShaderFile(const std::string &aFragmentShaderFilename)
Load the fragment shader from a file.
int m_vertex_source_number_of_lines
Number of line of the vertex shader.
void setLabel(const std::string &aComputeShaderLabel)
Set the compute shader label. This is useful for debugging.
unsigned int m_compute_shader_id
ID of the compute shader.
bool isValid() const
Accessor on the validity status of the shader.
char ** m_fragment_source
Source code of the fragment shader.
std::string m_fragment_shader_filename
Name of the file containing the fragment shader.
void linkProgram()
Link the vertex and fragment programs.
Class to handle GLSL shaders.
std::string m_vertex_shader_label
Label of the vertex shader.
void loadComputeShaderSource(const std::string &aComputeShaderSourceCode)
Load the compute shader from a string.
unsigned int compileShader(int aShaderType, int aLineNumber, char **aShaderSource)
Compile the vertex shader or the fragment shader.
Shader is a class to handle shaders written in GLSL.
Shader()
Default constructor.
char ** m_vertex_source
Source code of the vertex shader.
int m_fragment_source_number_of_lines
Number of line of the fragment shader.
int m_compute_source_number_of_lines
Number of line of the vertex shader.
unsigned int m_fragment_shader_id
ID of the fragment shader.
std::string m_compute_shader_label
Label of the compute shader.
void enable() const
Enable the current shader.
unsigned int getProgramHandle() const
Accessor on the shader program handle.
void loadComputeShaderFile(const std::string &aComputeShaderFilename)
Load the compute shader from a file.
char ** m_compute_source
Source code of the vertex shader.
void releaseSourceMemory(int &aLineNumber, char **&aShaderSource)
Release the memory held by the vertex shader or the fragment shader.
std::string m_fragment_shader_label
Label of the fragment shader.
void loadSource(const std::string &aVertexShaderSourceCode, const std::string &aFragmentShaderSourceCode)
Load the shader source code.
static bool m_shader_capable
Flag set to true when a shader if fully valid.
void setLabels(const std::string &aVertexShaderLabel, const std::string &aFragmentShaderLabel)
Set the vertex and fragment shader labels. This is useful for debugging.
void releaseVertexSourceMemory()
Release the memory held by the vertex shader.
void loadVertexShaderSource(const std::string &aVertexShaderSourceCode)
Load the vertex shader from a string.