CS::PluginCommon::Graphics2DCommon Class Reference
This is the base class for iGraphics2D implementations. More...
#include <csplugincommon/canvas/graph2d.h>

Public Member Functions | |
| virtual bool | BeginDraw () |
| This routine should be called before any draw operations. | |
| virtual void | Clear (int color) |
| Clear backbuffer. | |
| virtual void | ClearAll (int color) |
| Clear all video pages. | |
| virtual bool | ClipLine (float &x1, float &y1, float &x2, float &y2, int xmin, int ymin, int xmax, int ymax) |
| Clip a line against given rectangle Function returns true if line is not visible. | |
| virtual void | Close () |
| (*) Close graphics system | |
| virtual int | FindRGB (int r, int g, int b, int a=255) |
| Find an RGB (0..255) color. | |
| virtual void | FinishDraw () |
| This routine should be called when you finished drawing. | |
| virtual void | GetClipRect (int &xmin, int &ymin, int &xmax, int &ymax) |
| Query clipping rectangle. | |
| virtual iFontServer * | GetFontServer () |
| Gets the font server. | |
| virtual int | GetHeight () |
| Return the height of the viewport. | |
| const char * | GetHWGLVersion () |
| Get a string containing the OpenGL version. | |
| const char * | GetHWRenderer () |
| Get a string containing the hardware renderer. | |
| const char * | GetHWVendor () |
| Get a string containing the vendor info. | |
| virtual void | GetRGB (int color, int &r, int &g, int &b, int &a) |
| Retrieve the R,G,B,A tuple for a given color number. | |
| virtual void | GetRGB (int color, int &r, int &g, int &b) |
| Retrieve the R,G,B tuple for a given color number. | |
| void | GetViewport (int &left, int &top, int &width, int &height) |
| Get the currently set viewport. | |
| virtual int | GetWidth () |
| Return the width of the viewport. | |
| Graphics2DCommon () | |
| Create csGraphics2D object. | |
| virtual bool | HandleEvent (iEvent &) |
| Event handler for plugin. | |
| virtual bool | Initialize (iObjectRegistry *) |
| Initialize the plugin. | |
| virtual bool | Open () |
| (*) Open graphics system (set videomode, open window etc) | |
| virtual bool | PerformExtensionV (char const *command, va_list) |
| Perform a system specific extension. | |
| bool | Resize (int w, int h) |
| Resize the canvas. | |
| virtual void | SetClipRect (int xmin, int ymin, int xmax, int ymax) |
| Set clipping rectangle. | |
| void | SetViewport (int left, int top, int width, int height) |
| Set the viewport (the rectangle of the framebuffer to draw to). | |
| virtual | ~Graphics2DCommon () |
| Destroy csGraphics2D object. | |
| virtual void | Write (iFont *font, int x, int y, int fg, int bg, const wchar_t *text, uint flags=0) |
| Write a text string into the back buffer. | |
| virtual void | Write (iFont *font, int x, int y, int fg, int bg, const char *text, uint flags=0) |
| Write a text string into the back buffer. | |
Public Attributes | |
| int | ClipX1 |
| The clipping rectangle. | |
| csEventID | evCanvasResize |
| Resize event for the canvas we're associated with. | |
| csFontCache * | fontCache |
| The font cache. | |
| csWeakRef< iFontServer > | FontServer |
| The font server. | |
| int | FrameBufferLocked |
| The counter that is incremented inside BeginDraw and decremented in FinishDraw(). | |
| bool | is_open |
| Open/Close state. | |
| iObjectRegistry * | object_reg |
| The object registry. | |
| csWeakRef< iPluginManager > | plugin_mgr |
| The plugin manager. | |
Protected Member Functions | |
| void | HandleResize (iEvent &Event) |
| Handle a resize event from the canvas. | |
Detailed Description
This is the base class for iGraphics2D implementations.
Definition at line 64 of file graph2d.h.
Constructor & Destructor Documentation
| CS::PluginCommon::Graphics2DCommon::Graphics2DCommon | ( | ) |
Create csGraphics2D object.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual CS::PluginCommon::Graphics2DCommon::~Graphics2DCommon | ( | ) | [virtual] |
Destroy csGraphics2D object.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
Member Function Documentation
| virtual bool CS::PluginCommon::Graphics2DCommon::BeginDraw | ( | ) | [virtual] |
This routine should be called before any draw operations.
It should return true if graphics context is ready.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual void CS::PluginCommon::Graphics2DCommon::Clear | ( | int | color | ) | [virtual] |
| virtual void CS::PluginCommon::Graphics2DCommon::ClearAll | ( | int | color | ) | [virtual] |
Clear all video pages.
Implements iGraphics2D.
| virtual bool CS::PluginCommon::Graphics2DCommon::ClipLine | ( | float & | x1, | |
| float & | y1, | |||
| float & | x2, | |||
| float & | y2, | |||
| int | xmin, | |||
| int | ymin, | |||
| int | xmax, | |||
| int | ymax | |||
| ) | [virtual] |
Clip a line against given rectangle Function returns true if line is not visible.
Implements iGraphics2D.
| virtual void CS::PluginCommon::Graphics2DCommon::Close | ( | ) | [virtual] |
(*) Close graphics system
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual int CS::PluginCommon::Graphics2DCommon::FindRGB | ( | int | r, | |
| int | g, | |||
| int | b, | |||
| int | a = 255 | |||
| ) | [inline, virtual] |
Find an RGB (0..255) color.
The actual color bytes are returned.
Use returned value for color arguments in iGraphics2D.
Implements iGraphics2D.
| virtual void CS::PluginCommon::Graphics2DCommon::FinishDraw | ( | ) | [virtual] |
This routine should be called when you finished drawing.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual void CS::PluginCommon::Graphics2DCommon::GetClipRect | ( | int & | xmin, | |
| int & | ymin, | |||
| int & | xmax, | |||
| int & | ymax | |||
| ) | [virtual] |
Query clipping rectangle.
Implements iGraphics2D.
| virtual iFontServer* CS::PluginCommon::Graphics2DCommon::GetFontServer | ( | ) | [inline, virtual] |
| virtual int CS::PluginCommon::Graphics2DCommon::GetHeight | ( | ) | [inline, virtual] |
Return the height of the viewport.
Implements iGraphics2D.
| const char* CS::PluginCommon::Graphics2DCommon::GetHWGLVersion | ( | ) | [inline, virtual] |
Get a string containing the OpenGL version.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| const char* CS::PluginCommon::Graphics2DCommon::GetHWRenderer | ( | ) | [inline, virtual] |
Get a string containing the hardware renderer.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| const char* CS::PluginCommon::Graphics2DCommon::GetHWVendor | ( | ) | [inline, virtual] |
Get a string containing the vendor info.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual void CS::PluginCommon::Graphics2DCommon::GetRGB | ( | int | color, | |
| int & | r, | |||
| int & | g, | |||
| int & | b, | |||
| int & | a | |||
| ) | [inline, virtual] |
Retrieve the R,G,B,A tuple for a given color number.
Implements iGraphics2D.
| virtual void CS::PluginCommon::Graphics2DCommon::GetRGB | ( | int | color, | |
| int & | r, | |||
| int & | g, | |||
| int & | b | |||
| ) | [inline, virtual] |
Retrieve the R,G,B tuple for a given color number.
Implements iGraphics2D.
| void CS::PluginCommon::Graphics2DCommon::GetViewport | ( | int & | left, | |
| int & | top, | |||
| int & | width, | |||
| int & | height | |||
| ) | [inline, virtual] |
| virtual int CS::PluginCommon::Graphics2DCommon::GetWidth | ( | ) | [inline, virtual] |
| virtual bool CS::PluginCommon::Graphics2DCommon::HandleEvent | ( | iEvent & | ) | [virtual] |
Event handler for plugin.
Implements iEventHandler.
| void CS::PluginCommon::Graphics2DCommon::HandleResize | ( | iEvent & | Event | ) | [protected] |
Handle a resize event from the canvas.
| virtual bool CS::PluginCommon::Graphics2DCommon::Initialize | ( | iObjectRegistry * | ) | [virtual] |
Initialize the plugin.
Implements iComponent.
Reimplemented in csGraphics2D, CS::PluginCommon::GL::Graphics2DCommon, and csGraphics2DGLCommon.
| virtual bool CS::PluginCommon::Graphics2DCommon::Open | ( | ) | [virtual] |
(*) Open graphics system (set videomode, open window etc)
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual bool CS::PluginCommon::Graphics2DCommon::PerformExtensionV | ( | char const * | command, | |
| va_list | ||||
| ) | [virtual] |
Perform a system specific extension.
Return false if extension not supported.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| bool CS::PluginCommon::Graphics2DCommon::Resize | ( | int | w, | |
| int | h | |||
| ) | [virtual] |
| virtual void CS::PluginCommon::Graphics2DCommon::SetClipRect | ( | int | xmin, | |
| int | ymin, | |||
| int | xmax, | |||
| int | ymax | |||
| ) | [virtual] |
Set clipping rectangle.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| void CS::PluginCommon::Graphics2DCommon::SetViewport | ( | int | left, | |
| int | top, | |||
| int | width, | |||
| int | height | |||
| ) | [virtual] |
Set the viewport (the rectangle of the framebuffer to draw to).
- Parameters:
-
left Left of the viewport. X=0 will map to this. top Right of the viewport. Y=0 will map to this. width Width of the viewport. height Height of the viewport.
Implements iGraphics2D.
Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.
| virtual void CS::PluginCommon::Graphics2DCommon::Write | ( | iFont * | font, | |
| int | x, | |||
| int | y, | |||
| int | fg, | |||
| int | bg, | |||
| const wchar_t * | text, | |||
| uint | flags = 0 | |||
| ) | [virtual] |
Write a text string into the back buffer.
Implements iGraphics2D.
| virtual void CS::PluginCommon::Graphics2DCommon::Write | ( | iFont * | font, | |
| int | x, | |||
| int | y, | |||
| int | fg, | |||
| int | bg, | |||
| const char * | text, | |||
| uint | flags = 0 | |||
| ) | [virtual] |
Write a text string into the back buffer.
Implements iGraphics2D.
Member Data Documentation
The counter that is incremented inside BeginDraw and decremented in FinishDraw().
The documentation for this class was generated from the following file:
- csplugincommon/canvas/graph2d.h
Generated for Crystal Space 2.1 by doxygen 1.6.1
