csGraphics2DGLCommon Class Reference
[Common Plugin Classes]
Basic OpenGL version of the 2D driver class.
More...
#include <csplugincommon/opengl/glcommon2d.h>
Inheritance diagram for csGraphics2DGLCommon:

Public Types | |
typedef int | GLPixelFormat [glpfvValueCount] |
enum | GLPixelFormatValue |
Public Member Functions | |
virtual bool | BeginDraw () |
This routine should be called before any draw operations. | |
virtual void | Blit (int x, int y, int w, int h, unsigned char const *data) |
Blit. | |
virtual void | Clear (int color) |
Clear the screen with color. | |
virtual void | Close () |
(*) Close graphics system | |
csGraphics2DGLCommon (iBase *iParent) | |
Constructor does little, most initialization stuff happens in Initialize(). | |
virtual bool | DebugCommand (const char *cmd) |
Execute a debug command. | |
virtual bool | DoubleBuffer (bool Enable) |
Enable or disable double buffering; returns success status. | |
virtual void | DrawBox (int x, int y, int w, int h, int color) |
Draw a box. | |
virtual void | DrawLine (float x1, float y1, float x2, float y2, int color) |
Draw a line. | |
virtual void | DrawPixel (int x, int y, int color) |
Draw a pixel. | |
virtual void | DrawPixels (csPixelCoord const *pixels, int num_pixels, int color) |
Draw a series of pixels. | |
virtual int | FindRGB (int r, int g, int b, int a=255) |
Find an RGB (0. | |
virtual void | FinishDraw () |
This routine should be called when you finished drawing. | |
virtual bool | GetDoubleBufferState () |
Get the double buffer state. | |
virtual unsigned char * | GetPixelAt (int x, int y) |
Get address of video RAM at given x,y coordinates. | |
virtual void | GetRGB (int color, int &r, int &g, int &b, int &a) |
Retrieve the R,G,B,A tuple for a given color index. | |
virtual void | GetRGB (int color, int &r, int &g, int &b) |
Retrieve the R,G,B tuple for a given color index. | |
virtual bool | Initialize (iObjectRegistry *object_reg) |
Initialize the plugin. | |
virtual bool | Open () |
Initialize font cache, texture cache, prints renderer name and version. | |
virtual bool | PerformExtensionV (char const *command, va_list) |
Perform extension commands. | |
virtual bool | Resize (int width, int height) |
Resize the canvas. | |
virtual void | RestoreArea (csImageArea *Area, bool Free=true) |
Restore a subarea of screen saved with SaveArea(). | |
virtual csImageArea * | SaveArea (int x, int y, int w, int h) |
Save a subarea of screen area into the variable Data. | |
virtual csPtr< iImage > | ScreenShot () |
Do a screenshot: return a new iImage object. | |
virtual void | SetClipRect (int xmin, int ymin, int xmax, int ymax) |
Set clipping rectangle. | |
virtual void | SetRGB (int i, int r, int g, int b) |
Set a palette entry. | |
virtual | ~csGraphics2DGLCommon () |
Clear font cache etc. | |
iEventPlug implementation | |
virtual unsigned | GetPotentiallyConflictingEvents () |
Get the mask of events that can be generated by this source and are generated directly from user actions (e.g. | |
virtual unsigned | QueryEventPriority (unsigned) |
Query how strong the plug's wish to generate certain class of events is. | |
iGLDriverDatabase implementation | |
void | ReadDatabase (iDocumentNode *dbRoot, int configPriority=iConfigManager::ConfigPriorityPlugin+20, const char *phase=0) |
Read a custom driver database. | |
Public Attributes | |
csRef< iEventOutlet > | EventOutlet |
The event plug object. | |
Protected Member Functions | |
void | DecomposeColor (int iColor, float &oR, float &oG, float &oB, float &oA) |
Same but uses floating-point format. | |
void | DecomposeColor (int iColor, GLubyte &oR, GLubyte &oG, GLubyte &oB, GLubyte &oA) |
Decompose a color ID into r,g,b components. | |
void | OpenDriverDB (const char *phase=0) |
Open default driver database. | |
void | setGLColorfromint (int color) |
Set up current GL RGB color from a packed color format. | |
Protected Attributes | |
GLPixelFormat | currentFormat |
Depth buffer resolution. | |
csGLDriverDatabase | driverdb |
Driver database. | |
csGLExtensionManager | ext |
Extension manager. | |
bool | hasRenderTarget |
bool | multiFavorQuality |
Whether to favor quality or speed. | |
uint8 * | screen_shot |
csGLScreenShot * | ssPool |
csGLStateCache * | statecache |
Cache for GL states. | |
csGLStateCacheContext * | statecontext |
bool | useCombineTE |
Friends | |
class | csGLFontCache |
class | csGLPixelFormatPicker |
class | csGLScreenShot |
Classes | |
class | csGLPixelFormatPicker |
Detailed Description
Basic OpenGL version of the 2D driver class.You can look at one of the OpenGL canvas classes as an example of how to inherit and use this class. In short, inherit from this common class instead of from csGraphics2D, and override all the functions you normally would except for the 2D drawing functions, which are supplied for you here. That way all OpenGL drawing functions are unified over platforms, so that a fix or improvement will be inherited by all platforms instead of percolating via people copying code over.
Definition at line 59 of file glcommon2d.h.
Constructor & Destructor Documentation
|
Constructor does little, most initialization stuff happens in Initialize().
|
|
Clear font cache etc.
|
Member Function Documentation
|
This routine should be called before any draw operations. It should return true if graphics context is ready. Reimplemented from csGraphics2D. |
|
Blit.
Reimplemented from csGraphics2D. |
|
Clear the screen with color.
Reimplemented from csGraphics2D. |
|
(*) Close graphics system
Reimplemented from csGraphics2D. |
|
Execute a debug command.
Reimplemented from csGraphics2D. |
|
Same but uses floating-point format.
|
|
Decompose a color ID into r,g,b components.
|
|
Enable or disable double buffering; returns success status.
Reimplemented from csGraphics2D. Definition at line 268 of file glcommon2d.h. |
|
Draw a box.
Reimplemented from csGraphics2D. |
|
Draw a line.
Reimplemented from csGraphics2D. |
|
Draw a pixel.
Reimplemented from csGraphics2D. |
|
Draw a series of pixels.
Reimplemented from csGraphics2D. |
|
Find an RGB (0. .255) color. If there is a palette, this returns an entry index set with SetRGB(). If the returned value is -1, a suitable palette entry was not found. Without a palette, the actual color bytes are returned. Use returned value for color arguments in iGraphics2D. Reimplemented from csGraphics2D. Definition at line 209 of file glcommon2d.h. |
|
This routine should be called when you finished drawing.
Reimplemented from csGraphics2D. |
|
Get the double buffer state.
Reimplemented from csGraphics2D. Definition at line 265 of file glcommon2d.h. |
|
Get address of video RAM at given x,y coordinates. The OpenGL version of this function just returns 0 if not doing a screenshot. Reimplemented from csGraphics2D. |
|
Get the mask of events that can be generated by this source and are generated directly from user actions (e.g. key presses, mouse clicks and so on). This is used to locate potentialy conflicting combinations of event source plugins (for example two event sources may generate a csevKeyDown event each from every key press). The mask is a combination of CSEVTYPE_XXX values ORed together. Implements iEventPlug. Definition at line 279 of file glcommon2d.h. References CSEVTYPE_Keyboard, and CSEVTYPE_Mouse. |
|
Retrieve the R,G,B,A tuple for a given color index.
Reimplemented from csGraphics2D. Definition at line 227 of file glcommon2d.h. |
|
Retrieve the R,G,B tuple for a given color index.
Reimplemented from csGraphics2D. Definition at line 221 of file glcommon2d.h. |
|
Initialize the plugin.
Reimplemented from csGraphics2D. |
|
Initialize font cache, texture cache, prints renderer name and version. you should still print out the 2D driver type (X, Win, etc.) in your subclass code. Reimplemented from csGraphics2D. |
|
Open default driver database.
|
|
Perform extension commands.
Reimplemented from csGraphics2D. |
|
Query how strong the plug's wish to generate certain class of events is. The plug with the strongest wish wins. The argument is one of CSEVTYPE_XXX values (but never a combination of several OR'ed together). The typical value is somewhere around 100; the event plugs which are sometimes implemented inside the system drivers (such as for Windows and DJGPP) usually have the priority 100. Implements iEventPlug. Definition at line 281 of file glcommon2d.h. |
|
Read a custom driver database.
Reimplemented from iOpenGLDriverDatabase. Definition at line 287 of file glcommon2d.h. |
|
Resize the canvas.
Reimplemented from csGraphics2D. |
|
Restore a subarea of screen saved with SaveArea().
Reimplemented from csGraphics2D. |
|
Save a subarea of screen area into the variable Data. Storage is allocated in this call, you should either FreeArea() it after usage or RestoreArea() it. Reimplemented from csGraphics2D. |
|
Do a screenshot: return a new iImage object.
Reimplemented from csGraphics2D. |
|
Set clipping rectangle.
Reimplemented from csGraphics2D. |
|
Set up current GL RGB color from a packed color format.
|
|
Set a palette entry.
Reimplemented from csGraphics2D. |
Member Data Documentation
|
Depth buffer resolution.
Definition at line 138 of file glcommon2d.h. |
|
Driver database.
Definition at line 140 of file glcommon2d.h. |
|
The event plug object.
Definition at line 154 of file glcommon2d.h. |
|
Extension manager.
Definition at line 131 of file glcommon2d.h. |
|
Whether to favor quality or speed.
Definition at line 135 of file glcommon2d.h. |
|
Cache for GL states.
Definition at line 111 of file glcommon2d.h. |
The documentation for this class was generated from the following file:
- csplugincommon/opengl/glcommon2d.h
Generated for Crystal Space by doxygen 1.4.6