Debian Codegraph @

engine/core/gui/fifechan/base/sdl/sdl_gui_graphics.h

raw
1 /***************************************************************************
2 * Copyright (C) 2005-2019 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 #ifndef FIFE_GUI_SDL_GRAPHICS_H
23 #define FIFE_GUI_SDL_GRAPHICS_H
24
25 // Standard C++ library includes
26
27 // 3rd party library includes
28 #include <fifechan/sdl/sdlgraphics.hpp>
29
30 // FIFE includes
31 // These includes are split up in two parts, separated by one empty line
32 // First block: files included from the FIFE root src dir
33
34 namespace FIFE {
35 class RenderBackend;
36
37 /** Overrides Fifechan Graphics to enable usage of normal fife images & related facilities
38 */
39 class SdlGuiGraphics: public fcn::SDLGraphics {
40 public:
41 /** Constructor
42 */
43 SdlGuiGraphics();
44 void updateTarget();
45 virtual void drawImage(const fcn::Image* image, int32_t srcX, int32_t srcY, int32_t dstX, int32_t dstY, int32_t width, int32_t height);
46
47 virtual void drawText(const std::string& text, int32_t x, int32_t y, uint32_t alignment);
48 virtual void drawPoint(int32_t x, int32_t y);
49 virtual void drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
50 virtual void drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint32_t width);
51 virtual void drawPolyLine(const fcn::PointVector& points, uint32_t width);
52 virtual void drawBezier(const fcn::PointVector& points, int32_t steps, uint32_t width);
53 virtual void drawRectangle(const fcn::Rectangle& rectangle);
54 virtual void fillRectangle(const fcn::Rectangle& rectangle);
55 virtual void drawCircle(const fcn::Point& p, uint32_t radius);
56 virtual void drawFillCircle(const fcn::Point& p, uint32_t radius);
57 virtual void drawCircleSegment(const fcn::Point& p, uint32_t radius, int32_t sangle, int32_t eangle);
58 virtual void drawFillCircleSegment(const fcn::Point& p, uint32_t radius, int32_t sangle, int32_t eangle);
59
60 virtual void _beginDraw();
61 virtual void _endDraw();
62
63 virtual bool pushClipArea(fcn::Rectangle area);
64 virtual void popClipArea();
65
66 virtual void setColor(const fcn::Color& color);
67
68 private:
69 RenderBackend* m_renderbackend;
70 };
71 }
72
73 #endif