45 std::optional<const Texture2d*>
texture = std::nullopt;
48 std::optional<RotateQuad>
rotation = std::nullopt;
std::vector< VertexElementDescription > ShaderVertexAttributes
Describes all vertex inputs a shader requires like [vec3 position, vec3 normal, vec2 uv]
RenderLayer2 with_layer2(const RenderCommand &rc, const LayoutData &ld)
Layer with_layer(const InputCommand &rc, const LayoutData &ld)
RenderLayer3 with_layer3(const RenderCommand &rc, const LayoutData &ld)
An angle in both degrees and radians.
Represents a color with an alpha component. The color is stored in gamma (non-linear) space (aka sRGB...
A (inclusive) range between two values.
Represents color in gamma (non-linear) space (aka sRGB).
A list of CompiledVertexElement (for shader)
Rect viewport_aabb_in_worldspace
v2 mouse_to_world(const v2 &p) const
A "cache" for the current open gl state.
std::optional< const Texture2d * > texture
std::optional< Rect > texturecoord
void draw(SpriteBatch *batch, const Rect &screen)
std::optional< RotateQuad > rotation
CompiledShaderVertexAttributes quad_layout
Uniform view_projection_uniform
ShaderProgram quad_shader
ShaderVertexAttributes quad_description
Render2(OpenglStates *states)
Uniform transform_uniform
void clear(const Rgb &color, const LayoutData &ld) const
void clear(const Rgb &color, const LerpData &ld) const
RenderLayer2(const Layer &l, SpriteBatch *batch)
RenderLayer3(const Layer &l)
RAII representation of a open gl shader program.
void operator=(const SpriteBatch &)=delete
std::vector< float > data
SpriteBatch(const SpriteBatch &)=delete
SpriteBatch(OpenglStates *states, ShaderProgram *shader, Render2 *r)
void quad(std::optional< const Texture2d * > texture, const Vertex2 &v0, const Vertex2 &v1, const Vertex2 &v2, const Vertex2 &v3)
const Texture2d * current_texture
SpriteBatch(SpriteBatch &&)=delete
void operator=(SpriteBatch &&)=delete
static constexpr int max_quads