libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
Configuration of a 2D textured quad instance, for drawing as part of a RenderPass. More...
#include <donut/graphics/RenderPass.hpp>
Public Attributes | |
Shader2D * | shader = Shader2D::PLAIN |
Non-owning pointer to the shader to use when rendering this texture. More... | |
const Texture * | texture |
Non-owning pointer to the texture to be drawn. More... | |
vec2 | position {0.0f, 0.0f} |
Position, in world coordinates, to render the texture at, with respect to its TextureInstance::origin. More... | |
vec2 | scale {1.0f, 1.0f} |
Coefficients to scale the size of the texture by. More... | |
float | angle = 0.0f |
Angle, in radians, to rotate the texture by, around its TextureInstance::origin. More... | |
vec2 | origin {0.0f, 0.0f} |
Offset, in texture coordinates, specifying the origin relative to the bottom left of the texture. More... | |
vec2 | textureOffset {0.0f, 0.0f} |
Offset, in texture coordinates, to apply to the texture coordinates before sampling the texture. More... | |
vec2 | textureScale {1.0f, 1.0f} |
Coefficients to scale the texture coordinates by before sampling the texture. More... | |
Color | tintColor = Color::WHITE |
Tint color to use in the shader. More... | |
Configuration of a 2D textured quad instance, for drawing as part of a RenderPass.
Required fields:
Shader2D* donut::graphics::TextureInstance::shader = Shader2D::PLAIN |
Non-owning pointer to the shader to use when rendering this texture.
const Texture* donut::graphics::TextureInstance::texture |
Non-owning pointer to the texture to be drawn.
vec2 donut::graphics::TextureInstance::position {0.0f, 0.0f} |
Position, in world coordinates, to render the texture at, with respect to its TextureInstance::origin.
vec2 donut::graphics::TextureInstance::scale {1.0f, 1.0f} |
Coefficients to scale the size of the texture by.
The resulting textured quad will have the size of the original texture, multiplied by this value.
float donut::graphics::TextureInstance::angle = 0.0f |
Angle, in radians, to rotate the texture by, around its TextureInstance::origin.
vec2 donut::graphics::TextureInstance::origin {0.0f, 0.0f} |
Offset, in texture coordinates, specifying the origin relative to the bottom left of the texture.
For example, a value of (0.5, 0.5) would represent the middle of the texture.
vec2 donut::graphics::TextureInstance::textureOffset {0.0f, 0.0f} |
Offset, in texture coordinates, to apply to the texture coordinates before sampling the texture.
vec2 donut::graphics::TextureInstance::textureScale {1.0f, 1.0f} |
Coefficients to scale the texture coordinates by before sampling the texture.
Color donut::graphics::TextureInstance::tintColor = Color::WHITE |
Tint color to use in the shader.