25 #ifndef CPP3DS_RENDERTARGET_HPP
26 #define CPP3DS_RENDERTARGET_HPP
28 #include <cpp3ds/Graphics/Color.hpp>
29 #include <cpp3ds/Graphics/Rect.hpp>
30 #include <cpp3ds/Graphics/View.hpp>
31 #include <cpp3ds/Graphics/Transform.hpp>
32 #include <cpp3ds/Graphics/BlendMode.hpp>
33 #include <cpp3ds/Graphics/RenderStates.hpp>
34 #include <cpp3ds/Graphics/PrimitiveType.hpp>
35 #include <cpp3ds/Graphics/Vertex.hpp>
36 #include <cpp3ds/System/NonCopyable.hpp>
243 void draw(
const Vertex* vertices,
unsigned int vertexCount,
345 void applyCurrentView();
353 void applyBlendMode(
const BlendMode& mode);
361 void applyTransform(
const Transform& transform);
369 void applyTexture(
const Texture* texture);
377 void applyShader(
const Shader* shader);
391 virtual bool activate(
bool active) = 0;
399 enum {VertexCacheSize = 4};
404 Uint64 lastTextureId;
Shader class (vertex and fragment)
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.
Blending modes for drawing.
Utility class for manpulating RGBA colors.
void initialize()
Performs the common initialization step after creation.
Vector2f mapPixelToCoords(const Vector2i &point) const
Convert a point from target coordinates to world coordinates, using the current view.
virtual ~RenderTarget()
Destructor.
RenderTarget()
Default constructor.
const View & getDefaultView() const
Get the default view of the render target.
Define a point with color and texture coordinates.
virtual Vector2u getSize() const =0
Return the size of the rendering region of the target.
void pushGLStates()
Save the current OpenGL render states and matrices.
const View & getView() const
Get the view currently in use in the render target.
static const RenderStates Default
Special instance holding the default render states.
Abstract base class for objects that can be drawn to a 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.
Base class for all render targets (window, texture, ...)
Utility class that makes any derived class non-copyable.
Vector2i mapCoordsToPixel(const Vector2f &point) const
Convert a point from world coordinates to target coordinates, using the current view.
Define the states used for drawing to a RenderTarget.
PrimitiveType
Types of primitives that a cpp3ds::VertexArray can render.
IntRect getViewport(const View &view) const
Get the viewport of a view, applied to this render target.
void resetGLStates()
Reset the internal OpenGL states so that the target is ready for drawing.
2D camera that defines what region is shown on screen
some things could easily be broken///////