ADTF_DISPLAY_TOOLBOX
3.8.0 (ADTF 3.14.3)
|
Canvas interface. More...
Public Member Functions | |
ADTF_IID (ICanvas, "canvas.adtf_disptb.iid") | |
Define an interface id for this class | |
virtual tInt | GetWidth () const =0 |
Returns the width of the canvas. More... | |
virtual tInt | GetHeight () const =0 |
Returns the height of the canvas. More... | |
virtual tInt | GetBitsPerPixel () const =0 |
Returns the resolution of the canvas. More... | |
virtual tVoid | SetMapping (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Define a rectangle for the screen mapping. More... | |
virtual tVoid | ClearMapping ()=0 |
clears the mapping More... | |
virtual tInt | MapPixelX (tFloat32 x)=0 |
Map x coordinate to screen region. More... | |
virtual tInt | MapPixelY (tFloat32 y)=0 |
Map y coordinate to screen region. More... | |
virtual tInt | MapPixelX (tInt x)=0 |
Map x coordinate to screen region. More... | |
virtual tInt | MapPixelY (tInt y)=0 |
Map y coordinate to screen region. More... | |
virtual tFloat32 | UnmapPixelX (tInt x)=0 |
Unmap x coordinate from screen region to global coordinates. More... | |
virtual tFloat32 | UnmapPixelY (tInt y)=0 |
Unmap y coordinate from screen region to global coordinates. More... | |
virtual tVoid | Clear ()=0 |
Clears the canvas and all drawings to background color. More... | |
virtual tResult | CreateTexture (IImage *pImage, ITexture *&pTexture)=0 |
Handy method to create a texture from an image. More... | |
virtual tVoid | DrawTexture (ITexture *pTexture, tFloat32 vPoints[8])=0 |
Draws a texture into a polygon which is described with 4 points. More... | |
virtual tVoid | DrawPixel (tInt x, tInt y)=0 |
Draws a pixel at the given position. More... | |
virtual tVoid | DrawLine (tInt x1, tInt y1, tInt x2, tInt y2)=0 |
Draws a line between two given points. More... | |
virtual tVoid | DrawRect (tInt x1, tInt y1, tInt x2, tInt y2)=0 |
Draws a rectangle using two given corners. More... | |
virtual tVoid | DrawCircle (tInt x1, tInt y1, tInt x2, tInt y2)=0 |
Draws a circle. More... | |
virtual tVoid | DrawCircleSegment (tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0 |
Draws a circle segment (see. More... | |
virtual tVoid | FillRect (tInt x1, tInt y1, tInt x2, tInt y2)=0 |
Fills a rectangle with the current color. More... | |
virtual tVoid | FillCircle (tInt x1, tInt y1, tInt x2, tInt y2)=0 |
Fills a circle with the current color. More... | |
virtual tVoid | FillCircleSegment (tInt x1, tInt y1, tInt x2, tInt y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0 |
Fills a circle segment (see. More... | |
virtual tVoid | DrawPixel (tFloat32 x, tFloat32 y)=0 |
Draws a pixel at the given position. More... | |
virtual tVoid | DrawLine (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Draws a line between two given points. More... | |
virtual tVoid | DrawRect (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Draws a rectangle. More... | |
virtual tVoid | DrawCircle (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Draws a circle. More... | |
virtual tVoid | DrawCircleSegment (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0 |
Draws a circle segment (see. More... | |
virtual tVoid | FillRect (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Fills a rect with current color. More... | |
virtual tVoid | FillCircle (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2)=0 |
Fills a circle with current color. More... | |
virtual tVoid | FillCircleSegment (tFloat32 x1, tFloat32 y1, tFloat32 x2, tFloat32 y2, tFloat64 fDegreeStart, tFloat64 fDegreeEnd, tBool bNormalizeRect=tFalse)=0 |
Fills a circle segment (see. More... | |
virtual tVoid | DrawPixel (IPoint *pt)=0 |
Draws a pixel. More... | |
virtual tVoid | DrawLine (IPoint *ptStart, IPoint *ptEnd)=0 |
Draws a line between two points. More... | |
virtual tVoid | DrawRect (IRect *rect)=0 |
Draws a rectangle. More... | |
virtual tVoid | DrawPolygon (IPoint **ppPoints, tInt nCount)=0 |
Draws a polygon. More... | |
virtual tVoid | DrawCircle (IRect *rect)=0 |
Draws a circle inside a given rectangle. More... | |
virtual tVoid | DrawCircleSegment (IRect *rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd)=0 |
Draws a circle segment inside a given rectangle. More... | |
virtual tVoid | FillRect (IRect *rect)=0 |
Fills a rect with current color. More... | |
virtual tVoid | FillPolygon (IPoint **ppPoints, tInt nCount)=0 |
Fills a polygon by the given point array. More... | |
virtual tVoid | FillCircle (IRect *rect)=0 |
Fills a circle with current color. More... | |
virtual tVoid | FillCircleSegment (IRect *rect, tFloat64 fDegreeStart, tFloat64 fDegreeEnd)=0 |
Fills a circle segment with current color. More... | |
virtual IFont * | CreateFont (const char *strName, tInt nHeight, IFont::tStyle eFontStyle=IFont::STYLE_Default)=0 |
Creates a new font instance. More... | |
virtual tVoid | SetFontAngle (tFloat64 fAngle)=0 |
Sets the font angle. More... | |
virtual tFloat64 | GetFontAngle ()=0 |
** | |
virtual tVoid | Font (IFont *pFont)=0 |
** | |
virtual tVoid | OutputText (tInt x, tInt y, const tChar *fmt,...)=0 |
** | |
virtual tVoid | OutputText (tFloat32 x, tFloat32 y, const tChar *fmt,...)=0 |
** | |
virtual ITexture * | CreateTexture (const tBitmapFormat *psFormat, tInt nMode=0)=0 |
Creates a Texture in the given format. More... | |
virtual tVoid | Texture (ITexture *pTexture)=0 |
Sets a texture on canvas. More... | |
virtual tVoid | Blit (ITexture *pTexture, tInt x, tInt y, tInt nWidth, tInt nHeight)=0 |
Blits a texture on canvas. More... | |
virtual tVoid | Blit (IImage *pImage, tInt x, tInt y, tInt nWidth, tInt nHeight)=0 |
Blits an Image on canvas. More... | |
virtual tVoid | Capture (IImage **ppImage, tInt x, tInt y, tInt nWidth, tInt nHeight)=0 |
Captures the current canvas positions to an image. More... | |
virtual IScene * | BeginScene ()=0 |
Starts a 3D Scene context within the canvas. More... | |
virtual tVoid | EndScene ()=0 |
Ends the 3D Scene context within the canvas. More... | |
virtual tVoid | SetFlag (tUInt32 nFlag, tInt32 nValue)=0 |
Sets a flag with value. More... | |
virtual tInt32 | GetFlag (tUInt32 nFlag)=0 |
Returns a flagvalue. More... | |
virtual tResult | PushFlags ()=0 |
Stores the current set flags onto the flag stack. More... | |
virtual tResult | PopFlags ()=0 |
Restores the flags from the top the flag stack. More... | |
virtual tVoid | ResetFlags ()=0 |
Restores the default settings of all flags. | |
virtual tVoid | DrawEllipse (tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle)=0 |
Draws a ellipse. More... | |
virtual tVoid | DrawEllipse (tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle)=0 |
Draws a ellipse. More... | |
virtual tVoid | FillEllipse (tInt iOriginX, tInt iOriginY, tInt iWidth, tInt iHeight, tInt iAngle)=0 |
Fills a ellipse. More... | |
virtual tVoid | FillEllipse (tFloat32 f32OriginX, tFloat32 f32OriginY, tFloat32 f32Width, tFloat32 f32Height, tFloat32 f32Angle)=0 |
Fills a ellipse. More... | |
![]() | |
virtual | ~IGraphicsMode () |
virtual destructor to ensure proper cleanup. | |
virtual tBool | IsSupported (tFeature nFeatureId) const =0 |
This function returns if the features shown in tFeature is supported. More... | |
virtual tVoid | EnableAlpha (tBool bAdditiveMode=tFalse) const =0 |
This function enables the alpha graphics mode. More... | |
virtual tVoid | DisableAlpha () const =0 |
This function disables the alpha graphics mode. More... | |
virtual tVoid | EnableAntialiasing () const =0 |
This function enables the anti aliasing if feature is supported. More... | |
virtual tVoid | DisableAntialiasing () const =0 |
This function disables the anti aliasing. More... | |
virtual tVoid | EnableLighting () const =0 |
This function enables the lighting if feature is supported. More... | |
virtual tVoid | DisableLighting () const =0 |
This function disables the lighting. More... | |
virtual tVoid | EnableDepthBuffer () const =0 |
This function enables the depth buffer if feature is supported. More... | |
virtual tVoid | DisableDepthBuffer () const =0 |
This function disables the depth buffer. More... | |
virtual tVoid | EnableBackFaceCulling () const =0 |
This function enables the back face culling if supported. More... | |
virtual tVoid | DisableBackFaceCulling () const =0 |
This function disables the back face culling. More... | |
virtual tVoid | LineWidth (tFloat64 fWidth)=0 |
This function sets the current line width to the fWidth value. More... | |
virtual tVoid | LinePattern (tUInt16 ui16Pattern, tInt nFactor=1)=0 |
This function adjusts the Line Style for all Lines in drawing operations. More... | |
virtual tVoid | Color (const IColor *col)=0 |
This function sets the current color to col value. More... | |
virtual tVoid | Color (tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha=255)=0 |
This function sets the current color. More... | |
virtual tVoid | Color (tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha=255)=0 |
This function sets the current color. More... | |
virtual tVoid | Color (tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha=1.0)=0 |
This function sets the current color. More... | |
virtual tVoid | BgColor (const IColor *col)=0 |
This function sets the current background color to col value. More... | |
virtual tVoid | BgColor (tInt nRed, tInt nGreen, tInt nBlue, tInt nAlpha=0)=0 |
This function sets the current background color to col value. More... | |
virtual tVoid | BgColor (tUInt8 nRed, tUInt8 nGreen, tUInt8 nBlue, tUInt8 nAlpha=0)=0 |
This function sets the current background color to col value. More... | |
virtual tVoid | BgColor (tFloat64 fRed, tFloat64 fGreen, tFloat64 fBlue, tFloat64 fAlpha=0.0)=0 |
This function sets the current background color to col value. More... | |
virtual tVoid | Begin (tMode eMode)=0 |
Start graphics command. More... | |
virtual tVoid | Coord (tInt x, tInt y)=0 |
Set the context to the given coordinates. More... | |
virtual tVoid | Coord (tFloat32 x, tFloat32 y)=0 |
Set the context to the given coordinates. More... | |
virtual tVoid | Coord (IPoint *pt)=0 |
Set the context to the given coordinates. More... | |
virtual tVoid | Coord (IPoint **ppPoints, tInt nCount)=0 |
Set the context to the coordinate list. More... | |
virtual tVoid | CoordTexture (tFloat32 u, tFloat32 v)=0 |
Set the context to the coordinate list. More... | |
virtual tVoid | End ()=0 |
Ends a device context. More... | |
Additional Inherited Members | |
![]() | |
enum | tMode { MODE_DrawPoints , MODE_DrawLines , MODE_DrawLineStrip , MODE_DrawLineLoop , MODE_DrawTriangles , MODE_DrawTriangleStrip , MODE_DrawTriangleFan , MODE_DrawQuads , MODE_DrawQuadStrip , MODE_DrawPolygon } |
enumeration for the supported modes. More... | |
enum | tFeature { FEATURE_AlphaBlending , FEATURE_Antialiasing , FEATURE_Lighting , FEATURE_DepthBuffer , FEATURE_BackFaceCulling , FEATURE_CommandLists , FEATURE_HardwareAcceleration } |
This enumeration enables / disables or describes the features for the graphics mode. More... | |
Canvas interface.
The canvas interface encapsulates all 2D drawing functions. The canvas is to draw in any device context.
Definition at line 571 of file gfxlibinterfaces.h.
|
pure virtual |
Starts a 3D Scene context within the canvas.
Only call after call Begin. Do not forget to call EndScene when ready.
|
pure virtual |
Blits an Image on canvas.
Important: If you have disabled the hardware acceleration and use bitmap formats other than PF_RGBA_8888 or PF_RGB_888 this method can be slow, because it has to convert the format to be conform with Windows!
[in] | pImage | Image to blit. |
[in] | x | x coordinate |
[in] | y | y coordinate |
[in] | nWidth | width of the blit |
[in] | nHeight | height of the blit |
|
pure virtual |
Blits a texture on canvas.
[in] | pTexture | texture to blit. |
[in] | x | x coordinate |
[in] | y | y coordinate |
[in] | nWidth | width of the blit |
[in] | nHeight | height of the blit |
|
pure virtual |
Captures the current canvas positions to an image.
[out] | ppImage | referenced Image to blit. |
[in] | x | x coordinate |
[in] | y | y coordinate |
[in] | nWidth | width of the blit |
[in] | nHeight | height of the blit |
|
pure virtual |
Clears the canvas and all drawings to background color.
|
pure virtual |
clears the mapping
|
pure virtual |
Creates a new font instance.
The font object has to be deleted when it is not longer used.
[in] | strName | Name of the font. Only TrueType Fonts can be used. Windows: strName can specify a symbolic font name which are stored in the windows registry under "<Local-machine>\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", or strName can specify the filename of the file "windows/fonts/<strName>.ttf". e.g. "Courier New (TrueType)" and "COUR" specifies the same font. |
[in] | nHeight | Height of font in pixels |
[in] | eFontStyle | Style of font |
|
pure virtual |
Creates a Texture in the given format.
[in] | psFormat | format of the texture. |
[in] | nMode | see ITexture::tTextureMode. |
NULL | error occurred. |
Handy method to create a texture from an image.
(Finally calls pCanvas->CreateTexture)
pImage | [in] Image which is to be converted into a texture |
pTexture | [out] Result of this operation |
|
pure virtual |
Draws a circle inside a given rectangle.
rect | [in] given rectangle |
|
pure virtual |
Draws a circle.
the given points represents a rectangle. the circle will be drawed insides the spanned rectangle
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Draws a circle.
The given points represent a rectangle. The circle will be drawn inside this rectangle
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Draws a circle segment inside a given rectangle.
rect | [in] rectangle |
fDegreeStart | [in] start angle |
fDegreeEnd | [in] end angle |
|
pure virtual |
Draws a circle segment (see.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
fDegreeStart | [in] start of the segment |
fDegreeEnd | [in] end of the segment |
bNormalizeRect | [in] ensures that x1, y1 is the upper left and x2, y2 is the lower right corner of the rectangle |
|
pure virtual |
Draws a circle segment (see.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
fDegreeStart | [in] start of the segment |
fDegreeEnd | [in] end of the segment |
bNormalizeRect | [in] ensures that x1, y1 is the upper left and x2, y2 is the lower right corner of the rectangle |
|
pure virtual |
Draws a ellipse.
f32OriginX | [in] x-value of the origin point |
f32OriginY | [in] y-value of the origin point |
f32Width | [in] width of the ellipse |
f32Height | [in] height of the ellipse |
f32Angle | [in] angle of the ellipse orientation in degrees and clockwise |
|
pure virtual |
Draws a ellipse.
iOriginX | [in] x-value of the origin point |
iOriginY | [in] y-value of the origin point |
iWidth | [in] width of the ellipse |
iHeight | [in] height of the ellipse |
iAngle | [in] angle of the ellipse orientation in degrees and clockwise |
Draws a line between two points.
ptStart | [in] start point |
ptEnd | [in] end point |
|
pure virtual |
Draws a line between two given points.
x1 | [in] x position (start) |
y1 | [in] y position (start) |
x2 | [in] x position (end) |
y2 | [in] y position (end) |
|
pure virtual |
Draws a line between two given points.
x1 | [in] x position (start) |
y1 | [in] y position (start) |
x2 | [in] x position (end) |
y2 | [in] y position (end) |
|
pure virtual |
Draws a pixel.
pt | [in] given point |
|
pure virtual |
Draws a pixel at the given position.
x | [in] x position |
y | [in] y position |
|
pure virtual |
Draws a pixel at the given position.
x | [in] x position |
y | [in] y position |
|
pure virtual |
Draws a polygon.
ppPoints | [in] array of points |
nCount | [in] amount of array elements |
|
pure virtual |
Draws a rectangle.
rect | [in] given rectangle |
|
pure virtual |
Draws a rectangle.
using two given corners
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Draws a rectangle using two given corners.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Draws a texture into a polygon which is described with 4 points.
The texture will be stretched into this polygon
pTexture | [in] Pointer to the texture to blit |
vPoints | [in] Pointer to array with 8 floats describing 4 points (x1, y1, x2, y2, x3, y3, y4, y4) |
|
pure virtual |
Ends the 3D Scene context within the canvas.
Call to close the context when opened with BeginScene.
|
pure virtual |
Fills a circle with current color.
rect | [in] x, y positions of the first corner and second corner |
|
pure virtual |
Fills a circle with current color.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Fills a circle with the current color.
The given points represent a rectangle. The circle will be drawn inside this rectangle
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Fills a circle segment with current color.
rect | [in] x, y positions of the first corner and second corner |
fDegreeStart | [in] start of the segment |
fDegreeEnd | [in] end of the segment |
|
pure virtual |
Fills a circle segment (see.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
fDegreeStart | [in] start of the segment |
fDegreeEnd | [in] end of the segment |
bNormalizeRect | [in] ensures that x1, y1 is the upper left and x2, y2 is the lower right corner of the rectangle |
|
pure virtual |
Fills a circle segment (see.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
fDegreeStart | [in] start of the segment |
fDegreeEnd | [in] end of the segment |
bNormalizeRect | [in] ensures that x1, y1 is the upper left and x2, y2 is the lower right corner of the rectangle |
|
pure virtual |
Fills a ellipse.
f32OriginX | [in] x-value of the origin point |
f32OriginY | [in] y-value of the origin point |
f32Width | [in] width of the ellipse |
f32Height | [in] height of the ellipse |
f32Angle | [in] angle of the ellipse orientation in degrees and clockwise |
|
pure virtual |
Fills a ellipse.
iOriginX | [in] x-value of the origin point |
iOriginY | [in] y-value of the origin point |
iWidth | [in] width of the ellipse |
iHeight | [in] height of the ellipse |
iAngle | [in] angle of the ellipse orientation in degrees and clockwise |
|
pure virtual |
Fills a polygon by the given point array.
ppPoints | [in] a IPoint array reference |
nCount | [in] size of the array |
|
pure virtual |
Fills a rect with current color.
rect | [in] rectangle of the first and the second corner |
|
pure virtual |
Fills a rect with current color.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Fills a rectangle with the current color.
x1 | [in] x position of the first corner |
y1 | [in] y position of the first corner |
x2 | [in] x position of the second corner |
y2 | [in] y position of the second corner |
|
pure virtual |
Returns the resolution of the canvas.
|
pure virtual |
Returns a flagvalue.
[in] | nFlag | Flag to be returned. For valid flags see the tCanvasFlags enum |
|
pure virtual |
Returns the height of the canvas.
|
pure virtual |
Returns the width of the canvas.
|
pure virtual |
Map x coordinate to screen region.
x | [in] x coordinate to map |
|
pure virtual |
Map x coordinate to screen region.
x | [in] x coordinate to map |
|
pure virtual |
Map y coordinate to screen region.
y | [in] y coordinate to map |
|
pure virtual |
Map y coordinate to screen region.
y | [in] y coordinate to map |
|
pure virtual |
Restores the flags from the top the flag stack.
ERR_OUT_OF_RANGE | The flag stack is empty |
|
pure virtual |
Stores the current set flags onto the flag stack.
ERR_OUT_OF_RANGE | The flags does not fit in the flag stack |
|
pure virtual |
Sets a flag with value.
For valid flags and posible values see tCanvasFlags enum
[in] | nFlag | Flag to be set. For valid flags see the tCanvasFlags enum |
[in] | nValue | Flagvalue |
|
pure virtual |
Sets the font angle.
[in] | fAngle | angle to be set |
|
pure virtual |
Define a rectangle for the screen mapping.
x1 | [in] Upper left x coordinate |
y1 | [in] Upper left y coordinate |
x2 | [in] Bottom right x coordinate |
y2 | [in] Bottom right y coordinate |
|
pure virtual |
Sets a texture on canvas.
[in] | pTexture | texture to set. |
|
pure virtual |
Unmap x coordinate from screen region to global coordinates.
x | [in] x coordinate to unmap |
|
pure virtual |
Unmap y coordinate from screen region to global coordinates.
y | [in] y coordinate to unmap |