Loading...
Searching...
No Matches
RenderStates.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#pragma once
26
28// Headers
31
36
37
38namespace sf
39{
40class Shader;
41class Texture;
42
48{
62 RenderStates() = default;
63
70 RenderStates(const BlendMode& theBlendMode);
71
78 RenderStates(const StencilMode& theStencilMode);
79
86 RenderStates(const Transform& theTransform);
87
94 RenderStates(const Texture* theTexture);
95
102 RenderStates(const Shader* theShader);
103
115 RenderStates(const BlendMode& theBlendMode,
116 const StencilMode& theStencilMode,
117 const Transform& theTransform,
118 CoordinateType theCoordinateType,
119 const Texture* theTexture,
120 const Shader* theShader);
121
123 // Static member data
125 // NOLINTNEXTLINE(readability-identifier-naming)
126 static const RenderStates Default;
127
129 // Member data
134 CoordinateType coordinateType{CoordinateType::Pixels};
135 const Texture* texture{};
136 const Shader* shader{};
137};
138
139} // namespace sf
140
141
#define SFML_GRAPHICS_API
Shader class (vertex, geometry and fragment)
Definition Shader.hpp:54
Image living on the graphics card that can be used for drawing.
Definition Texture.hpp:56
3x3 transform matrix
Definition Transform.hpp:48
CoordinateType
Types of texture coordinates that can be used for rendering.
const BlendMode BlendAlpha
Blend source and dest according to dest alpha.
Blending modes for drawing.
Definition BlendMode.hpp:41
Define the states used for drawing to a RenderTarget
RenderStates()=default
Default constructor.
Transform transform
Transform.
RenderStates(const Shader *theShader)
Construct a default set of render states with a custom shader.
RenderStates(const Transform &theTransform)
Construct a default set of render states with a custom transform.
RenderStates(const BlendMode &theBlendMode, const StencilMode &theStencilMode, const Transform &theTransform, CoordinateType theCoordinateType, const Texture *theTexture, const Shader *theShader)
Construct a set of render states with all its attributes.
RenderStates(const Texture *theTexture)
Construct a default set of render states with a custom texture.
StencilMode stencilMode
Stencil mode.
RenderStates(const BlendMode &theBlendMode)
Construct a default set of render states with a custom blend mode.
static const RenderStates Default
Special instance holding the default render states.
RenderStates(const StencilMode &theStencilMode)
Construct a default set of render states with a custom stencil mode.
Stencil modes for drawing.