Ocular Engine
Ocular::Graphics::ShaderProgram Class Reference

#include <ShaderProgram.hpp>

Inheritance diagram for Ocular::Graphics::ShaderProgram:
Ocular::Core::Resource

Public Member Functions

virtual void unload () override
 
void setVertexShader (VertexShader *shader)
 
VertexShadergetVertexShader ()
 
void setGeometryShader (GeometryShader *shader)
 
GeometryShadergetGeometryShader ()
 
void setFragmentShader (FragmentShader *shader)
 
FragmentShadergetFragmentShader ()
 
void setPreTessellationShader (PreTessellationShader *shader)
 
PreTessellationShadergetPreTessellationShader ()
 
void setPostTessellationShader (PostTessellationShader *shader)
 
PostTessellationShadergetPostTessellationShader ()
 
void setPixelShader (PixelShader *shader)
 
PixelShadergetPixelShader ()
 
void setHullShader (HullShader *shader)
 
HullShadergetHullShader ()
 
void setDomainShader (DomainShader *shader)
 
DomainShadergetDomainShader ()
 
- Public Member Functions inherited from Ocular::Core::Resource
 Resource (File const &source)
 
virtual void forceLoad ()
 
File getSourceFile () const
 
void setSourceFile (File const &file)
 
void setIsInMemory (bool inMemory)
 
bool isInMemory () const
 
void setSize (uint64_t size)
 
uint64_t getSize () const
 
ResourceType getResourceType () const
 
void setName (std::string const &name)
 
std::string const & getName () const
 
std::string const & getMappingName () const
 
void setMappingName (std::string const &name)
 
ResourceMetadatagetMetadata () const
 
void setMetadata (ResourceMetadata *metadata)
 

Protected Attributes

VertexShaderm_VertexShader
 
GeometryShaderm_GeometryShader
 
FragmentShaderm_FragmentShader
 
PreTessellationShaderm_PreTessellationShader
 
PostTessellationShaderm_PostTessellationShader
 
- Protected Attributes inherited from Ocular::Core::Resource
ResourceType m_Type
 
ResourceMetadatam_Metadata
 
File m_SourceFile
 
bool m_IsInMemory
 
uint64_t m_SizeInMemory
 
std::string m_Name
 
std::string m_MappingName
 

Detailed Description

A ShaderProgram is a collection of individual shader objects.

When a shader file is loaded (.hlsl, .glsl, etc.), a ShaderProgram object is created that contains all individual shaders found within the file.

Member Function Documentation

DomainShader * Ocular::Graphics::ShaderProgram::getDomainShader ( )

Returns a pointer to the Domain Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::setPostTessellationShader
Returns
Pointer to the Domain Shader; Returns NULL if no Domain Shader is present.
FragmentShader * Ocular::Graphics::ShaderProgram::getFragmentShader ( )

Returns a pointer to the Fragment Shader that belongs to this shader program.

Returns
Pointer to the Fragment Shader; Returns NULL if no Fragment Shader is present.
GeometryShader * Ocular::Graphics::ShaderProgram::getGeometryShader ( )

Returns a pointer to the Geometry Shader that belongs to this shader program.

Returns
Pointer to the Geometry Shader; Returns NULL if no Geometry Shader is present.
HullShader * Ocular::Graphics::ShaderProgram::getHullShader ( )

Returns a pointer to the Hull Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::getPreTessellationShader
Returns
Pointer to the Hull Shader; Returns NULL if no Hull Shader is present.
PixelShader * Ocular::Graphics::ShaderProgram::getPixelShader ( )

Returns a pointer to the Pixel Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::setFragmentShader
Returns
Pointer to the Pixel Shader; Returns NULL if no Pixel Shader is present.
PostTessellationShader * Ocular::Graphics::ShaderProgram::getPostTessellationShader ( )

Returns a pointer to the Post-Tessellation Shader that belongs to this shader program.

Returns
Pointer to the Post-Tessellation Shader; Returns NULL if no Post-Tessellation Shader is present.
PreTessellationShader * Ocular::Graphics::ShaderProgram::getPreTessellationShader ( )

Returns a pointer to the Pre-Tessellation Shader that belongs to this shader program.

Returns
Pointer to the Pre-Tessellation Shader; Returns NULL if no Pre-Tessellation Shader is present.
VertexShader * Ocular::Graphics::ShaderProgram::getVertexShader ( )

Returns a pointer to the Vertex Shader that belongs to this shader program.

Returns
Pointer to the Vertex Shader; Returns NULL if no Vertex Shader is present.
void Ocular::Graphics::ShaderProgram::setDomainShader ( DomainShader shader)

Sets the Domain Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::setPostTessellationShader
Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setFragmentShader ( FragmentShader shader)

Sets the Fragment Shader that belongs to this shader program.

Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setGeometryShader ( GeometryShader shader)

Sets the Geometr Shader that belongs to this shader program.

Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setHullShader ( HullShader shader)

Sets the Hull Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::setPreTessellationShader
Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setPixelShader ( PixelShader shader)

Sets the Pixel Shader that belongs to this shader program.

Note
This method is identical to ShaderProgram::setPixelShader
Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setPostTessellationShader ( PostTessellationShader shader)

Sets the Post-Tessellation Shader that belongs to this shader program.

Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setPreTessellationShader ( PreTessellationShader shader)

Sets the Pre-Tessellation Shader that belongs to this shader program.

Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::setVertexShader ( VertexShader shader)

Sets the Vertex Shader that belongs to this shader program.

Parameters
[in]shader
void Ocular::Graphics::ShaderProgram::unload ( )
overridevirtual

Frees all memory used by this Resource.

Reimplemented from Ocular::Core::Resource.


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