5#ifndef INCLUDE_FIFECHAN_GRAPHICS_HPP_
6#define INCLUDE_FIFECHAN_GRAPHICS_HPP_
14#include "fifechan/cliprectangle.hpp"
15#include "fifechan/platform.hpp"
16#include "fifechan/point.hpp"
56 class FIFEGUI_API Graphics
116 virtual bool pushClipArea(
Rectangle area);
123 virtual void popClipArea();
155 virtual void drawImage(
Image const * image,
int srcX,
int srcY,
int dstX,
int dstY,
int width,
int height) = 0;
181 virtual void drawLine(
int x1,
int y1,
int x2,
int y2) = 0;
192 virtual void drawLine(
int x1,
int y1,
int x2,
int y2,
unsigned int width) = 0;
220 virtual void drawPolyLine(PointVector
const & points,
unsigned int width) = 0;
229 virtual void drawBezier(PointVector
const & points,
int steps,
unsigned int width) = 0;
351 virtual std::shared_ptr<Font>
createFont(std::string
const & filename,
int size);
362 void drawText(std::string
const & text,
int x,
int y)
364 drawText(text, x, y, Alignment::Left);
376 virtual void drawText(std::string
const & text,
int x,
int y, Alignment alignment);
A rectangle specifically used for clipping rendering regions.
Abstract interface for font rendering.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual void drawPoint(int x, int y)=0
Draws a single point/pixel.
void fillRectangle(int x, int y, int width, int height)
Draws a filled rectangle.
virtual void drawPolyLine(PointVector const &points, unsigned int width)=0
Draws lines between points with given width.
Font * mFont
Holds the current font.
Alignment
Alignments for text drawing.
virtual void drawBezier(PointVector const &points, int steps, unsigned int width)=0
Draws a bezier curve.
virtual void drawFillCircleSegment(Point const &p, unsigned int radius, int sangle, int eangle)=0
Draws a filled circle segment.
virtual void drawLine(int x1, int y1, int x2, int y2, unsigned int width)=0
Draws a thick line.
virtual void drawCircleSegment(Point const &p, unsigned int radius, int sangle, int eangle)=0
Draws a simple, non-filled circle segment with a one pixel width.
virtual void drawImage(Image const *image, int srcX, int srcY, int dstX, int dstY, int width, int height)=0
Draws a part of an image.
void drawRectangle(int x, int y, int width, int height)
Draws a simple, non-filled rectangle with a one pixel width.
virtual void drawCircle(Point const &p, unsigned int radius)=0
Draws a simple, non-filled circle with a one pixel width.
void drawText(std::string const &text, int x, int y)
Draws text with a default left alignment.
virtual void setFont(Font *font)
Sets the font to use when drawing text.
virtual std::shared_ptr< Font > createFont(std::string const &filename, int size)
Creates a font for this graphics backend.
std::stack< ClipRectangle > mClipStack
Holds the clip area stack.
virtual void drawLine(int x1, int y1, int x2, int y2)=0
Draws a line.
virtual void _beginDraw()
Initializes drawing.
virtual void drawFillCircle(Point const &p, unsigned int radius)=0
Draws a filled circle.
virtual void setColor(Color const &color)=0
Sets the color to use when drawing.
virtual void drawRectangle(Rectangle const &rectangle)=0
Draws a simple, non-filled rectangle with a one pixel width.
virtual void fillRectangle(Rectangle const &rectangle)=0
Draws a filled rectangle.
virtual Color const & getColor() const =0
Gets the color to use when drawing.
virtual void drawRoundStroke(int x1, int y1, int x2, int y2, unsigned int width)
Draws a round brush stroke along the line segment.
virtual void _endDraw()
Deinitializes the drawing process.
Abstract holder for image data.
Represents a 2D coordinate (X, Y).
Represents a rectangular area (X, Y, Width, Height).