320 std::
size_t vertexCount,
343 std::
size_t firstVertex,
344 std::
size_t vertexCount,
361 [[nodiscard]] virtual
bool isSrgb() const;
383 [[nodiscard]] virtual
bool setActive(
bool active = true);
474 void applyCurrentView();
482 void applyBlendMode(const
BlendMode& mode);
498 void applyTransform(const
Transform& transform);
515 void applyShader(const
Shader* shader);
524 void setupDraw(
bool useVertexCache, const
RenderStates& states);
534 void drawPrimitives(
PrimitiveType type, std::
size_t firstVertex, std::
size_t vertexCount);
553 bool scissorEnabled{};
554 bool stencilEnabled{};
557 std::uint64_t lastTextureId{};
559 bool texCoordsArrayEnabled{};
560 bool useVertexCache{};
561 std::array<Vertex, 4> vertexCache{};
569 StatesCache m_cache{};
570 std::uint64_t m_id{};
#define SFML_GRAPHICS_API
Definition Export.hpp:42
Utility class for manipulating RGBA colors.
Definition Color.hpp:40
Abstract base class for objects that can be drawn to a render target.
Definition Drawable.hpp:44
void setView(const View &view)
Change the current active view.
void draw(const Drawable &drawable, const RenderStates &states=RenderStates::Default)
Draw a drawable object to the render target.
IntRect getScissor(const View &view) const
Get the scissor rectangle of a view, applied to this render target.
virtual Vector2u getSize() const =0
Return the size of the rendering region of the target.
void clearStencil(StencilValue stencilValue)
Clear the stencil buffer to a specific value.
Vector2f mapPixelToCoords(Vector2i point) const
Convert a point from target coordinates to world coordinates, using the current view.
const View & getDefaultView() const
Get the default view of the render target.
IntRect getViewport(const View &view) const
Get the viewport of a view, applied to this render target.
void pushGLStates()
Save the current OpenGL render states and matrices.
RenderTarget(RenderTarget &&) noexcept=default
Move constructor.
void resetGLStates()
Reset the internal OpenGL states so that the target is ready for drawing.
RenderTarget & operator=(const RenderTarget &)=delete
Deleted copy assignment.
Vector2i mapCoordsToPixel(Vector2f point) const
Convert a point from world coordinates to target coordinates, using the current view.
virtual ~RenderTarget()=default
Destructor.
void popGLStates()
Restore the previously saved OpenGL render states and matrices.
const View & getView() const
Get the view currently in use in the render target.
virtual bool setActive(bool active=true)
Activate or deactivate the render target for rendering.
virtual bool isSrgb() const
Tell if the render target will use sRGB encoding when drawing on it.
RenderTarget(const RenderTarget &)=delete
Deleted copy constructor.
void clear(Color color=Color::Black)
Clear the entire target with a single color.
void initialize()
Performs the common initialization step after creation.
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
Vertex buffer storage for one or more 2D primitives.
Definition VertexBuffer.hpp:51
2D camera that defines what region is shown on screen
Definition View.hpp:46
Definition BlendMode.hpp:34
CoordinateType
Types of texture coordinates that can be used for rendering.
Definition CoordinateType.hpp:38
PrimitiveType
Types of primitives that a sf::VertexArray can render.
Definition PrimitiveType.hpp:39
Vector2< unsigned int > Vector2u
Definition Vector2.hpp:225
Rect< int > IntRect
Definition Rect.hpp:153
Vector2< int > Vector2i
Definition Vector2.hpp:224
Vector2< float > Vector2f
Definition Vector2.hpp:226
Blending modes for drawing.
Definition BlendMode.hpp:41
Define the states used for drawing to a RenderTarget.
Definition RenderStates.hpp:48
Stencil modes for drawing.
Definition StencilMode.hpp:107
Stencil value type (also used as a mask).
Definition StencilMode.hpp:75
Define a point with color and texture coordinates.
Definition Vertex.hpp:44