FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
opengl_gui_graphics.h
Go to the documentation of this file.
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_OPENGL_GRAPHICS_H
23 #define FIFE_GUI_OPENGL_GRAPHICS_H
24 
25 // Standard C++ library includes
26 
27 // 3rd party library includes
28 #include <fifechan/opengl/openglgraphics.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 RenderBackendOpenGL;
36 
39  class OpenGLGuiGraphics: public fcn::OpenGLGraphics {
40  public:
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:
70  };
71 }
72 
73 #endif
virtual void setColor(const fcn::Color &color)
virtual void fillRectangle(const fcn::Rectangle &rectangle)
virtual void drawFillCircleSegment(const fcn::Point &p, uint32_t radius, int32_t sangle, int32_t eangle)
virtual void drawRectangle(const fcn::Rectangle &rectangle)
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)
std::vector< Point > PointVector
Definition: point.h:197
virtual void drawCircleSegment(const fcn::Point &p, uint32_t radius, int32_t sangle, int32_t eangle)
virtual void drawPolyLine(const fcn::PointVector &points, uint32_t width)
virtual void drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
PointType2D< int32_t > Point
Definition: point.h:195
Overrides Fifechan Graphics to enable usage of normal fife images & related facilities.
RenderBackendOpenGL * m_renderbackend
virtual void drawText(const std::string &text, int32_t x, int32_t y, uint32_t alignment)
virtual bool pushClipArea(fcn::Rectangle area)
virtual void drawBezier(const fcn::PointVector &points, int32_t steps, uint32_t width)
unsigned int uint32_t
Definition: core.h:40
virtual void drawCircle(const fcn::Point &p, uint32_t radius)
virtual void drawFillCircle(const fcn::Point &p, uint32_t radius)
virtual void drawPoint(int32_t x, int32_t y)
The main class of the OpenGL-based renderer.