#include
<oglplus/shader.hpp>
template <> struct ObjectSubtype<tag::Shader> { typedef ShaderType Type; }; template <> class ObjCommonOps<tag::Shader> : public ShaderName { public: #if GL_ES_VERSION_3_0 || GL_VERSION_4_1 || GL_ARB_ES2_compatibility static void PrecisionFormat( ShaderType shader_type, PrecisionType precision_type, GLint* range_log_2, GLint* precision_log_2 ); };
Gets the shader precision format. See |
template <> class ObjectOps<tag::DirectState, tag::Shader> : public ObjZeroOps<tag::DirectState, tag::Shader> { public: struct Property { typedef ShaderType Type; }; ShaderType Type(void) const; ObjectOps& Source( const SizeType count, const GLchar* const * srcs, const GLint* lens ); ObjectOps& Source(GLSLString&& source); ObjectOps& Source(GLSLStrings&& source); ObjectOps& Source(const GLSLSource& glsl_source); Boolean IsCompiled(void) const; ObjectOps& Compile(void); Outcome<ObjectOps&> Compile(std::nothrow_t); String GetInfoLog(void) const; #if GL_ARB_shading_language_include ObjectOps& CompileInclude( SizeType count, const GLchar* const* paths, const GLint* lengths ); ObjectOps& CompileInclude(GLSLString&& incl); ObjectOps& CompileInclude(GLSLStrings&& incl); ObjectOps& CompileInclude(const GLSLSource& incl); Outcome<ObjectOps&> CompileInclude( SizeType count, const GLchar* const* paths, const GLint* lengths, std::nothrow_t ); Outcome<ObjectOps&> CompileInclude(GLSLString&& incl, std::nothrow_t); Outcome<ObjectOps&> CompileInclude(GLSLStrings&& incl, std::nothrow_t); Outcome<ObjectOps&> CompileInclude(const GLSLSource& incl, std::nothrow_t); #endif #if GL_ES_VERSION_3_0 || GL_VERSION_4_1 || GL_ARB_ES2_compatibility static void ReleaseCompiler(void); #endif };
Indirectly inherits from ObjCommonOps<tag::Shader>. |
|
Returns the type of |
|
Set the source code of this shader. See |
|
Returns true if the shader is already compiled, returns false otherwise.
See |
|
Compiles |
|
This overload of |
|
Returns the compiler output if the shader is compiled. See |
|
Compiles the shader using the specified include paths. See |
|
Indicates that the resources associated with the compiler can be freed.
See |
typedef ObjectOps<tag::DirectState, tag::Shader> ShaderOps; class Shader : public Object<ShaderOps> { public: Shader(ShaderType type); Shader(ShaderType type, ObjectDesc&& description); Shader(ShaderType type, GLSLString&& glsl_source); Shader(ShaderType type, GLSLStrings&& glsl_source); Shader(ShaderType type, const GLSLSource& glsl_source); Shader( ShaderType type, ObjectDesc&& description, GLSLString&& glsl_source ); Shader( ShaderType type, ObjectDesc&& description, GLSLStrings&& glsl_source ); Shader( ShaderType type, ObjectDesc&& description, const GLSLSource& glsl_source ); Shader(const Shader&) = delete; Shader(Shader&&); Shader& operator = (Shader&&); };
template <ShaderType Type> class SpecShader : public Shader { public: SpecShader(void); SpecShader(ObjectDesc&& description); SpecShader(GLSLString&& glsl_source); SpecShader(GLSLStrings&& glsl_source); SpecShader(const GLSLSource& glsl_source); SpecShader(ObjectDesc&& description, GLSLString&& glsl_source); SpecShader(ObjectDesc&& description, GLSLStrings&& glsl_source); SpecShader(ObjectDesc&& description, const GLSLSource& glsl_source); SpecShader(const SpecShader&) = delete; SpecShader(SpecShader&&); }; typedef SpecShader<ShaderType::Vertex> VertexShader; #if GL_TESS_CONTROL_SHADER typedef SpecShader<ShaderType::TessControl> TessControlShader; #endif #if GL_TESS_EVALUATION_SHADER typedef SpecShader<ShaderType::TessEvaluation> TessEvaluationShader; #endif #if GL_GEOMETRY_SHADER typedef SpecShader<ShaderType::Geometry> GeometryShader; #endif typedef SpecShader<ShaderType::Fragment> FragmentShader; #if GL_COMPUTE_SHADER typedef SpecShader<ShaderType::Compute> ComputeShader; #endif