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
Utility class for manipulating RGBA colors.
Abstract base class for objects that can be drawn to a render target.
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)
Image living on the graphics card that can be used for drawing.
Vertex buffer storage for one or more 2D primitives.
2D camera that defines what region is shown on screen
CoordinateType
Types of texture coordinates that can be used for rendering.
PrimitiveType
Types of primitives that a sf::VertexArray can render.
@ Pixels
Texture coordinates in range [0 .. size].
Vector2< unsigned int > Vector2u
Vector2< float > Vector2f
Blending modes for drawing.
Define the states used for drawing to a RenderTarget
Stencil modes for drawing.
Stencil value type (also used as a mask)
Point with color and texture coordinates.