libdonut
2.3.2
Application framework for cross-platform game development in C++20
|
Configuration of a 2D rectangle instance, optionally textured, 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 rectangle. More... | |
const Texture * | texture = Texture::WHITE |
Non-owning pointer to a texture to apply to the rectangle. More... | |
vec2 | position {0.0f, 0.0f} |
Position, in world coordinates, to render the rectangle at, with respect to its RectangleInstance::origin. More... | |
vec2 | size {1.0f, 1.0f} |
Size of the rectangle, in world coordinates. More... | |
float | angle = 0.0f |
Angle, in radians, to rotate the rectangle by, around its RectangleInstance::origin. More... | |
vec2 | origin {0.0f, 0.0f} |
Offset, in texture coordinates, specifying the origin relative to the bottom left of the rectangle. 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 rectangle instance, optionally textured, for drawing as part of a RenderPass.
Shader2D* donut::graphics::RectangleInstance::shader = Shader2D::PLAIN |
Non-owning pointer to the shader to use when rendering this rectangle.
const Texture* donut::graphics::RectangleInstance::texture = Texture::WHITE |
Non-owning pointer to a texture to apply to the rectangle.
vec2 donut::graphics::RectangleInstance::position {0.0f, 0.0f} |
Position, in world coordinates, to render the rectangle at, with respect to its RectangleInstance::origin.
vec2 donut::graphics::RectangleInstance::size {1.0f, 1.0f} |
Size of the rectangle, in world coordinates.
float donut::graphics::RectangleInstance::angle = 0.0f |
Angle, in radians, to rotate the rectangle by, around its RectangleInstance::origin.
vec2 donut::graphics::RectangleInstance::origin {0.0f, 0.0f} |
Offset, in texture coordinates, specifying the origin relative to the bottom left of the rectangle.
For example, a value of (0.5, 0.5) would represent the middle of the rectangle.
vec2 donut::graphics::RectangleInstance::textureOffset {0.0f, 0.0f} |
Offset, in texture coordinates, to apply to the texture coordinates before sampling the texture.
vec2 donut::graphics::RectangleInstance::textureScale {1.0f, 1.0f} |
Coefficients to scale the texture coordinates by before sampling the texture.
Color donut::graphics::RectangleInstance::tintColor = Color::WHITE |
Tint color to use in the shader.
When no texture is specified, this controls the base color of the rectangle.