CrystalSpace

Public API Reference

CS::PluginCommon::Graphics2DCommon Class Reference

This is the base class for iGraphics2D implementations. More...

#include <csplugincommon/canvas/graph2d.h>

Inheritance diagram for CS::PluginCommon::Graphics2DCommon:

List of all members.

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 iFontServerGetFontServer ()
 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.
csFontCachefontCache
 The font cache.
csWeakRef< iFontServerFontServer
 The font server.
int FrameBufferLocked
 The counter that is incremented inside BeginDraw and decremented in FinishDraw().
bool is_open
 Open/Close state.
iObjectRegistryobject_reg
 The object registry.
csWeakRef< iPluginManagerplugin_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]

Clear backbuffer.

Implements iGraphics2D.

Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.

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.

Definition at line 141 of file graph2d.h.

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]

Gets the font server.

Implements iGraphics2D.

Definition at line 186 of file graph2d.h.

virtual int CS::PluginCommon::Graphics2DCommon::GetHeight (  )  [inline, virtual]

Return the height of the viewport.

Implements iGraphics2D.

Definition at line 121 of file graph2d.h.

const char* CS::PluginCommon::Graphics2DCommon::GetHWGLVersion (  )  [inline, virtual]

Get a string containing the OpenGL version.

Implements iGraphics2D.

Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.

Definition at line 203 of file graph2d.h.

const char* CS::PluginCommon::Graphics2DCommon::GetHWRenderer (  )  [inline, virtual]

Get a string containing the hardware renderer.

Implements iGraphics2D.

Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.

Definition at line 201 of file graph2d.h.

const char* CS::PluginCommon::Graphics2DCommon::GetHWVendor (  )  [inline, virtual]

Get a string containing the vendor info.

Implements iGraphics2D.

Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.

Definition at line 205 of file graph2d.h.

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.

Definition at line 159 of file graph2d.h.

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.

Definition at line 153 of file graph2d.h.

void CS::PluginCommon::Graphics2DCommon::GetViewport ( int &  left,
int &  top,
int &  width,
int &  height 
) [inline, virtual]

Get the currently set viewport.

Implements iGraphics2D.

Definition at line 198 of file graph2d.h.

virtual int CS::PluginCommon::Graphics2DCommon::GetWidth (  )  [inline, virtual]

Return the width of the viewport.

Implements iGraphics2D.

Definition at line 120 of file graph2d.h.

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]

Resize the canvas.

Implements iGraphics2D.

Reimplemented in CS::PluginCommon::GL::Graphics2DCommon.

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 clipping rectangle.

Definition at line 71 of file graph2d.h.

Resize event for the canvas we're associated with.

Definition at line 76 of file graph2d.h.

The font cache.

Definition at line 86 of file graph2d.h.

The font server.

Definition at line 84 of file graph2d.h.

The counter that is incremented inside BeginDraw and decremented in FinishDraw().

Definition at line 95 of file graph2d.h.

Open/Close state.

Definition at line 74 of file graph2d.h.

The object registry.

Definition at line 79 of file graph2d.h.

The plugin manager.

Definition at line 81 of file graph2d.h.


The documentation for this class was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1