Material class
#include <nCine/Graphics/Material.h>
Contains material data for a drawable node.
Public types
- enum class ShaderProgramType { Sprite = 0, SpriteNoTexture, MeshSprite, MeshSpriteNoTexture, BatchedSprites, BatchedSpritesNoTexture, BatchedMeshSprites, BatchedMeshSpritesNoTexture, Custom }
- One of the predefined shader programs.
Constructors, destructors, conversion operators
- Material()
- Default constructor.
- Material(GLShaderProgram* program, GLTexture* texture)
Public functions
- auto IsBlendingEnabled() const -> bool
- void SetBlendingEnabled(bool blendingEnabled)
- auto GetSrcBlendingFactor() const -> GLenum
- auto GetDestBlendingFactor() const -> GLenum
- void SetBlendingFactors(GLenum srcBlendingFactor, GLenum destBlendingFactor)
- auto GetShaderProgramType() const -> ShaderProgramType
- auto SetShaderProgramType(ShaderProgramType shaderProgramType) -> bool
- auto GetShaderProgram() const -> const GLShaderProgram*
- void SetShaderProgram(GLShaderProgram* program)
- auto SetShader(Shader* shader) -> bool
- void SetDefaultAttributesParameters()
- void ReserveUniformsDataMemory()
- void SetUniformsDataPointer(GLubyte* dataPointer)
- auto HasUniform(const char* name) const -> bool
- Wrapper around
GLShaderUniforms::hasUniform(). - auto HasUniformBlock(const char* name) const -> bool
- Wrapper around
GLShaderUniformBlocks::hasUniformBlock(). - auto Uniform(const char* name) -> GLUniformCache*
- Wrapper around
GLShaderUniforms::uniform(). - auto UniformBlock(const char* name) -> GLUniformBlockCache*
- Wrapper around
GLShaderUniformBlocks::uniformBlock(). - auto GetAllUniforms() const -> const GLShaderUniforms::UniformHashMapType
- Wrapper around
GLShaderUniforms::allUniforms(). - auto GetAllUniformBlocks() const -> const GLShaderUniformBlocks::UniformHashMapType
- Wrapper around
GLShaderUniformBlocks::allUniformBlocks(). -
auto GetTexture(std::
uint32_t unit) const -> const GLTexture* -
auto SetTexture(std::
uint32_t unit, const GLTexture* texture) -> bool -
auto SetTexture(std::
uint32_t unit, const Texture& texture) -> bool - auto GetTexture() const -> const GLTexture*
- auto SetTexture(const GLTexture* texture) -> bool
- auto SetTexture(const Texture& texture) -> bool
Constants
- static char InstanceBlockName constexpr
- static char InstancesBlockName constexpr
- static char ModelMatrixUniformName constexpr
- static char GuiProjectionMatrixUniformName constexpr
- static char DepthUniformName constexpr
- static char ProjectionMatrixUniformName constexpr
- static char ViewMatrixUniformName constexpr
- static char ProjectionViewMatrixExcludeString constexpr
- static char TextureUniformName constexpr
- static char ColorUniformName constexpr
- static char SpriteSizeUniformName constexpr
- static char TexRectUniformName constexpr
- static char PositionAttributeName constexpr
- static char TexCoordsAttributeName constexpr
- static char MeshIndexAttributeName constexpr
- static char ColorAttributeName constexpr
Enum documentation
enum class nCine:: Material:: ShaderProgramType
One of the predefined shader programs.
| Enumerators | |
|---|---|
| Sprite |
Shader program for Sprite classes. |
| SpriteNoTexture |
Shader program for Sprite classes with a solid color and no texture. |
| MeshSprite |
Shader program for MeshSprite classes. |
| MeshSpriteNoTexture |
Shader program for MeshSprite classes with a solid color and no texture. |
| BatchedSprites |
Shader program for a batch of Sprite classes. |
| BatchedSpritesNoTexture |
Shader program for a batch of Sprite classes with solid colors and no texture. |
| BatchedMeshSprites |
Shader program for a batch of MeshSprite classes. |
| BatchedMeshSpritesNoTexture |
Shader program for a batch of MeshSprite classes with solid colors and no texture. |
| Custom |
A custom shader program. |