_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
MyOpenGLGraphics Class Reference

#include <widgets.h>

Inheritance diagram for MyOpenGLGraphics:
gcn::Graphics

Public Member Functions

virtual void setColor (const gcn::Color &color)
 
virtual const gcn::ColorgetColor ()
 
widgets.cpp - The stratagus ui widgets.
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)
 
- Public Member Functions inherited from gcn::Graphics
 Graphics ()
 
virtual ~Graphics ()
 
virtual bool pushClipArea (Rectangle area)
 
virtual void popClipArea ()
 
virtual const ClipRectanglegetCurrentClipArea ()
 
virtual void drawImage (const Image *image, int dstX, int dstY)
 
virtual void setFont (Font *font)
 
virtual void drawText (const std::string &text, int x, int y, unsigned int alignment=LEFT, bool is_normal=true)
 

Additional Inherited Members

- Public Types inherited from gcn::Graphics
enum  { LEFT = 0, CENTER, RIGHT }
 
- Protected Attributes inherited from gcn::Graphics
std::stack< ClipRectanglemClipStack
 
FontmFont
 

Member Function Documentation

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.

See also
_endDraw, Gui::draw

Reimplemented from gcn::Graphics.

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.

See also
_beginDraw, Gui::draw

Reimplemented from gcn::Graphics.

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);

Will draw a rectangular piece of myImage starting at coordinate (10, 10) in myImage, with width and height 40. The piece will be drawn with it's top left corner at coordinate (20, 20).

Parameters
imagethe Image to draw.
srcXsource Image x coordinate.
srcYsource Image y coordinate.
dstXdestination x coordinate.
dstYdestination y coordinate.
widththe width of the piece.
heightthe height of the piece.

Implements gcn::Graphics.

void MyOpenGLGraphics::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
virtual

Ddraws a line.

Parameters
x1the first x coordinate.
y1the first y coordinate.
x2the second x coordinate.
y2the second y coordinate.

Implements gcn::Graphics.

void MyOpenGLGraphics::drawPoint ( int  x,
int  y 
)
virtual

Draws a single point/pixel.

Parameters
xthe x coordinate.
ythe y coordinate.

Implements gcn::Graphics.

void MyOpenGLGraphics::drawRectangle ( const gcn::Rectangle rectangle)
virtual

Draws a simple, non-filled, Rectangle with one pixel width.

Parameters
rectanglethe Rectangle to draw.

Implements gcn::Graphics.

void MyOpenGLGraphics::fillRectangle ( const gcn::Rectangle rectangle)
virtual

Draws a filled Rectangle.

Parameters
rectanglethe filled Rectangle to draw.

Implements gcn::Graphics.

virtual const gcn::Color& MyOpenGLGraphics::getColor ( )
inlinevirtual

Gets the Color to use when drawing.

Returns
the Color used when drawing.

Implements gcn::Graphics.

virtual void MyOpenGLGraphics::setColor ( const gcn::Color color)
inlinevirtual

Sets the Color to use when drawing.

Parameters
colora Color.

Implements gcn::Graphics.


The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.