#include <ugraphics.hpp>
Inheritance diagram for ufo::UGraphics:
Public Types | |
enum | VertexType { Points, Lines, LineStrip, Triangles, TriangleStrip, TriangleFan } |
enum | GCState { Blending = 1, SmoothShading, LineAntialiasing, FillAntialiasing } |
Public Member Functions | |
virtual UContext * | getContext () const =0 |
virtual URectangle | mapToDevice (const URectangle &rect)=0 |
virtual URectangle | mapFromDevice (const URectangle &rect)=0 |
virtual void | begin ()=0 |
virtual void | end ()=0 |
virtual void | clear ()=0 |
virtual UImageIO * | dump ()=0 |
virtual void | resetDeviceAttributes () |
virtual void | resetDeviceViewMatrix () |
void | flush () |
virtual void | setEnabled (GCState state, bool b)=0 |
virtual bool | isEnabled (GCState state) const =0 |
virtual void | setColor (const UColor &color)=0 |
virtual UColor | getColor () const =0 |
virtual void | setClearColor (const UColor &clearColor)=0 |
virtual UColor | getClearColor () const =0 |
virtual void | setFont (const UFont &font)=0 |
virtual UFont | getFont () const =0 |
virtual void | drawString (const std::string &string, int x=0, int y=0)=0 |
virtual UDimension | getStringSize (const std::string &string)=0 |
virtual void | setClipRect (const URectangle &rect)=0 |
virtual URectangle | getClipRect () const =0 |
virtual void | setLineWidth (float width)=0 |
virtual float | getLineWidth () const =0 |
virtual void | translate (float x, float y)=0 |
virtual float | getTranslationX () const =0 |
virtual float | getTranslationY () const =0 |
virtual void | drawRect (const URectangle &rect)=0 |
virtual void | fillRect (const URectangle &rect)=0 |
virtual void | drawLine (const UPoint &p1, const UPoint &p2)=0 |
virtual void | drawVertexArray (VertexType type, UVertexArray *buffer)=0 |
virtual void | drawImage (UImage *image, const URectangle &rect)=0 |
virtual void | drawSubImage (UImage *image, const URectangle &srcRect, const URectangle &destRect)=0 |
void | drawRect (int x, int y, int w, int h) |
void | fillRect (int x, int y, int w, int h) |
void | drawLine (int x1, int y1, int x2, int y2) |
void | drawImage (UImage *image, int x, int y) |
void | drawImage (UImage *image, const UPoint &p) |
void | drawImage (UImage *image, int x, int y, int w, int h) |
void | drawSubImage (UImage *image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY) |
void | drawSubImage (UImage *image, const URectangle &srcRect, const UPoint &destLocation) |
void | drawSubImage (UImage *image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) |
The first argument of every drawing method (paint
...) is a pointer to the graphics object.
The graphics object may paint directly to the screen, to an OpenGL context or to an offscreen image.
|
Begins drawing operations. This sets all desired states and view transformation for painting UFO widgets. Drawing may be cached and delayed until the end call (or even later). Implemented in ufo::UGL_Graphics.
|
|
Clears the screen with the clear color. Implemented in ufo::UGL_Graphics.
|
|
|
|
Draws the given image at the specified position, eventually scaled on the fly when width and height differ from the image size.
Implemented in ufo::UGL_Graphics.
|
|
Draws a line with the given coordinates and the current color. Implemented in ufo::UGL_Graphics.
|
|
draws the outline of the given rectangle with the current writing color. Implemented in ufo::UGL_Graphics.
|
|
Draws the given character string at the specified position using the current font. Implemented in ufo::UGL_Graphics.
|
|
|
|
Draws the given image at the specified position, eventually scaled on the fly when width and height differ from the sub image size. If destRect.w and destRect.h are 0, the image is drawn without scaling
Implemented in ufo::UGL_Graphics.
|
|
Draws the given vertex array with the given drawing method. Note that for triangles, only convex polygons are allowed. Order should always be clockwise! Implemented in ufo::UGL_Graphics.
|
|
Dumps the screen contence to the new image io object. May be very slow when using hardware accelereated rendering. Implemented in ufo::UGL_Graphics.
|
|
Ends drawing operations and reverts all changed states to the old state. Flushes all drawing operations. Implemented in ufo::UGL_Graphics.
|
|
fills the given rectangle with the current writing color. Implemented in ufo::UGL_Graphics.
|
|
Reimplemented in ufo::UGL_Graphics.
|
|
Returns the clip rect in root coordinates. Implemented in ufo::UGL_Graphics.
|
|
Returns the color which was previously set by setColor. May differ from the color of the underlying graphics context, when the color was directly set (without this graphics object).
Implemented in ufo::UGL_Graphics.
|
|
Returns the context which is used for the drawing operations. Implemented in ufo::UGL_Graphics.
|
|
Returns the font for this graphics object. Implemented in ufo::UGL_Graphics.
|
|
Returns the bounding rect for the given character string using the current font. Implemented in ufo::UGL_Graphics.
|
|
Maps the rectangle rect from the underlying graphics device, i.e. the OpenGL context to root coordinates! (which means to coordinates of the root pane) Implemented in ufo::UGL_Graphics.
|
|
Maps the rectangle rect, which is in the coordinate space of this graphics object, to the underlying graphics device, i.e. the OpenGL context. Implemented in ufo::UGL_Graphics.
|
|
Explicitly resets attributes. Is also called by
Reimplemented in ufo::UGL_Graphics.
|
|
Explicitly resets the view matrix. Is also called by
Reimplemented in ufo::UGL_Graphics.
|
|
Sets the clip rect in root coordinates. If rect is empty, clipping is disabled. Implemented in ufo::UGL_Graphics.
|
|
Sets the color for this graphics object. Changes internally the color for the underlying graphics context.
Implemented in ufo::UGL_Graphics.
|
|
Sets the font for this graphics object. Implemented in ufo::UGL_Graphics.
|
|
Translates the coordinate system by the given x and y values. Implemented in ufo::UGL_Graphics.
|