____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <widgets.h>

Public Member Functions | |
| virtual void | _beginDraw () |
| virtual void | _endDraw () |
| virtual void | drawImage (const gcn::Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height) |
| virtual void | drawPoint (int x, int y) |
| virtual void | drawLine (int x1, int y1, int x2, int y2) |
| virtual void | drawRectangle (const gcn::Rectangle &rectangle) |
| virtual void | fillRectangle (const gcn::Rectangle &rectangle) |
| virtual void | setColor (const gcn::Color &color) |
| virtual const gcn::Color & | getColor () |
Definition at line 52 of file widgets.h.
| void MyOpenGLGraphics::_beginDraw | ( | ) | [virtual] |
Initializes drawing. Called by the Gui when Gui::draw() is called. It is needed by some implementations of Graphics to perform preparations before drawing. An example of such an implementation would be OpenGLGraphics.
NOTE: You will never need to call this function yourself. Gui will do it for you.
Reimplemented from gcn::Graphics.
Definition at line 212 of file widgets.cpp.
References CVideo::Height, gcn::Graphics::pushClipArea(), Video, and CVideo::Width.
| void MyOpenGLGraphics::_endDraw | ( | ) | [virtual] |
Deinitializes drawing. Called by the Gui when a Gui::draw() is done. done. It should reset any state changes made by _beginDraw().
NOTE: You will never need to call this function yourself. Gui will do it for you.
Reimplemented from gcn::Graphics.
Definition at line 218 of file widgets.cpp.
References gcn::Graphics::popClipArea().
| void MyOpenGLGraphics::drawImage | ( | const gcn::Image * | image, | |
| int | srcX, | |||
| int | srcY, | |||
| int | dstX, | |||
| int | dstY, | |||
| int | width, | |||
| int | height | |||
| ) | [virtual] |
Draws a part of an Image.
NOTE: Width and height arguments will not scale the Image but specifies the size of the part to be drawn. If you want to draw the whole Image there is a simplified version of this function.
EXAMPLE:
drawImage(myImage, 10, 10, 20, 20, 40, 40);
| image | the Image to draw. | |
| srcX | source Image x coordinate. | |
| srcY | source Image y coordinate. | |
| dstX | destination x coordinate. | |
| dstY | destination y coordinate. | |
| width | the width of the piece. | |
| height | the height of the piece. |
Implements gcn::Graphics.
Definition at line 223 of file widgets.cpp.
References gcn::Graphics::getCurrentClipArea(), CVideo::Height, gcn::Rectangle::height, gcn::Graphics::mClipStack, PopClipping(), PushClipping(), SetClipping(), Video, CVideo::Width, gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.
| void MyOpenGLGraphics::drawPoint | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
Draws a single point/pixel.
| x | the x coordinate. | |
| y | the y coordinate. |
Implements gcn::Graphics.
Definition at line 241 of file widgets.cpp.
References gcn::Color::a, gcn::Color::b, CVideo::DrawPixelClip(), gcn::Color::g, getColor(), CVideo::MapRGBA(), gcn::Graphics::mClipStack, gcn::Color::r, and Video.
| void MyOpenGLGraphics::drawLine | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) | [virtual] |
Ddraws a line.
| x1 | the first x coordinate. | |
| y1 | the first y coordinate. | |
| x2 | the second x coordinate. | |
| y2 | the second y coordinate. |
Implements gcn::Graphics.
Definition at line 248 of file widgets.cpp.
References gcn::Color::a, gcn::Color::b, CVideo::DrawLineClip(), gcn::Color::g, getColor(), CVideo::MapRGBA(), gcn::Graphics::mClipStack, gcn::Color::r, and Video.
| void MyOpenGLGraphics::drawRectangle | ( | const gcn::Rectangle & | rectangle | ) | [virtual] |
Draws a simple, non-filled, Rectangle with one pixel width.
| rectangle | the Rectangle to draw. |
Implements gcn::Graphics.
Definition at line 256 of file widgets.cpp.
References gcn::Color::a, gcn::Color::b, CVideo::DrawTransRectangle(), gcn::Color::g, getColor(), gcn::Rectangle::height, gcn::Rectangle::intersect(), CVideo::MapRGB(), gcn::Graphics::mClipStack, gcn::Color::r, Video, gcn::Rectangle::width, gcn::Rectangle::x, gcn::ClipRectangle::xOffset, gcn::Rectangle::y, and gcn::ClipRectangle::yOffset.
| void MyOpenGLGraphics::fillRectangle | ( | const gcn::Rectangle & | rectangle | ) | [virtual] |
Draws a filled Rectangle.
| rectangle | the filled Rectangle to draw. |
Implements gcn::Graphics.
Definition at line 278 of file widgets.cpp.
References gcn::Color::a, gcn::Color::b, CVideo::FillTransRectangle(), gcn::Color::g, getColor(), gcn::Rectangle::height, gcn::Rectangle::intersect(), CVideo::MapRGB(), gcn::Graphics::mClipStack, gcn::Color::r, Video, gcn::Rectangle::width, gcn::Rectangle::x, gcn::ClipRectangle::xOffset, gcn::Rectangle::y, and gcn::ClipRectangle::yOffset.
| virtual void MyOpenGLGraphics::setColor | ( | const gcn::Color & | color | ) | [inline, virtual] |
| virtual const gcn::Color& MyOpenGLGraphics::getColor | ( | ) | [inline, virtual] |
Gets the Color to use when drawing.
Implements gcn::Graphics.
Definition at line 67 of file widgets.h.
Referenced by drawLine(), drawPoint(), drawRectangle(), and fillRectangle().
1.5.6