class
#include <nCine/Graphics/Material.h>
Material 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.
Public static variables
- 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
Constructors, destructors, conversion operators
- Material()
- Default constructor.
- Material(GLShaderProgram* program, GLTexture* texture)
Public functions
- auto isBlendingEnabled() const -> bool
- void setBlendingEnabled(bool blendingEnabled)
- auto srcBlendingFactor() const -> GLenum
- auto destBlendingFactor() const -> GLenum
- void setBlendingFactors(GLenum srcBlendingFactor, GLenum destBlendingFactor)
- auto shaderProgramType() const -> ShaderProgramType
- auto setShaderProgramType(ShaderProgramType shaderProgramType) -> bool
- auto shaderProgram() 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 allUniforms() const -> const GLShaderUniforms::
UniformHashMapType - Wrapper around
GLShaderUniforms::allUniforms()
-
auto allUniformBlocks() const -> const GLShaderUniformBlocks::
UniformHashMapType - Wrapper around
GLShaderUniformBlocks::allUniformBlocks()
- auto texture(unsigned int unit) const -> const GLTexture*
- auto setTexture(unsigned int unit, const GLTexture* texture) -> bool
- auto setTexture(unsigned int unit, const Texture& texture) -> bool
- auto texture() const -> const GLTexture*
- auto setTexture(const GLTexture* texture) -> bool
- auto setTexture(const Texture& texture) -> bool
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. |