25 #ifndef SFML_RENDERTARGET_HPP
26 #define SFML_RENDERTARGET_HPP
31 #include <SFML/Graphics/Export.hpp>
32 #include <SFML/Graphics/Color.hpp>
33 #include <SFML/Graphics/Rect.hpp>
34 #include <SFML/Graphics/View.hpp>
35 #include <SFML/Graphics/Transform.hpp>
36 #include <SFML/Graphics/BlendMode.hpp>
37 #include <SFML/Graphics/RenderStates.hpp>
38 #include <SFML/Graphics/PrimitiveType.hpp>
39 #include <SFML/Graphics/Vertex.hpp>
40 #include <SFML/System/NonCopyable.hpp>
392 void applyCurrentView();
400 void applyBlendMode(
const BlendMode& mode);
408 void applyTransform(
const Transform& transform);
416 void applyTexture(
const Texture* texture);
424 void applyShader(
const Shader* shader);
433 void setupDraw(
bool useVertexCache,
const RenderStates& states);
443 void drawPrimitives(
PrimitiveType type, std::size_t firstVertex, std::size_t vertexCount);
459 enum {VertexCacheSize = 4};
465 Uint64 lastTextureId;
466 bool texCoordsArrayEnabled;
468 Vertex vertexCache[VertexCacheSize];
483 #endif // SFML_RENDERTARGET_HPP
Utility class for manipulating RGBA colors.
Vector2i mapCoordsToPixel(const Vector2f &point, const View &view) const
Convert a point from world coordinates to target coordinates.
const View & getDefaultView() const
Get the default view of the render target.
Vector2i mapCoordsToPixel(const Vector2f &point) const
Convert a point from world coordinates to target coordinates, using the current view.
virtual bool setActive(bool active=true)
Activate or deactivate the render target for rendering.
static const RenderStates Default
Special instance holding the default render states.
2D camera that defines what region is shown on screen
Vertex buffer storage for one or more 2D primitives.
RenderTarget()
Default constructor.
IntRect getViewport(const View &view) const
Get the viewport of a view, applied to this render target.
void initialize()
Performs the common initialization step after creation.
Blending modes for drawing.
Abstract base class for objects that can be drawn to a render target.
void resetGLStates()
Reset the internal OpenGL states so that the target is ready for drawing.
Image living on the graphics card that can be used for drawing.
Define the states used for drawing to a RenderTarget.
void draw(const Drawable &drawable, const RenderStates &states=RenderStates::Default)
Draw a drawable object to the render target.
void clear(const Color &color=Color(0, 0, 0, 255))
Clear the entire target with a single color.
void popGLStates()
Restore the previously saved OpenGL render states and matrices.
Vector2f mapPixelToCoords(const Vector2i &point, const View &view) const
Convert a point from target coordinates to world coordinates.
void setView(const View &view)
Change the current active view.
Utility class that makes any derived class non-copyable.
const View & getView() const
Get the view currently in use in the render target.
Base class for all render targets (window, texture, ...)
virtual ~RenderTarget()
Destructor.
void draw(const VertexBuffer &vertexBuffer, const RenderStates &states=RenderStates::Default)
Draw primitives defined by a vertex buffer.
Define a point with color and texture coordinates.
Shader class (vertex, geometry and fragment)
virtual Vector2u getSize() const =0
Return the size of the rendering region of the target.
void draw(const Vertex *vertices, std::size_t vertexCount, PrimitiveType type, const RenderStates &states=RenderStates::Default)
Draw primitives defined by an array of vertices.
Vector2f mapPixelToCoords(const Vector2i &point) const
Convert a point from target coordinates to world coordinates, using the current view.
void pushGLStates()
Save the current OpenGL render states and matrices.
void draw(const VertexBuffer &vertexBuffer, std::size_t firstVertex, std::size_t vertexCount, const RenderStates &states=RenderStates::Default)
Draw primitives defined by a vertex buffer.
PrimitiveType
Types of primitives that a sf::VertexArray can render.