#include <graph2d.h>
Inheritance diagram for iGraphics2D:
Public Methods | |
virtual bool | Open ()=0 |
Open the device. | |
virtual void | Close ()=0 |
Close the device. | |
virtual int | GetWidth ()=0 |
Return the width of the framebuffer. | |
virtual int | GetHeight ()=0 |
Return the height of the framebuffer. | |
virtual int | GetPage ()=0 |
Get active videopage number (starting from zero). | |
virtual bool | DoubleBuffer (bool Enable)=0 |
Enable or disable double buffering; returns success status. | |
virtual bool | GetDoubleBufferState ()=0 |
Get the double buffer state. | |
virtual csPixelFormat* | GetPixelFormat ()=0 |
Return information about the pixel format. | |
virtual int | GetPixelBytes ()=0 |
Return the number of bytes for every pixel. More... | |
virtual int | GetPalEntryCount ()=0 |
Return the number of palette entries that can be modified. More... | |
virtual csRGBpixel* | GetPalette ()=0 |
Get the palette (if there is one). | |
virtual void | SetRGB (int i, int r, int g, int b)=0 |
Set a color index to given R,G,B (0..255) values. | |
virtual void | SetClipRect (int nMinX, int nMinY, int nMaxX, int nMaxY)=0 |
Set clipping rectangle. | |
virtual void | GetClipRect (int &nMinX, int &nMinY, int &nMaxX, int &nMaxY)=0 |
Retrieve clipping rectangle. | |
virtual bool | BeginDraw ()=0 |
This routine should be called before any draw operations. More... | |
virtual void | FinishDraw ()=0 |
This routine should be called when you finished drawing. | |
virtual void | Print (csRect *pArea)=0 |
Flip video pages (or dump backbuffer into framebuffer). More... | |
virtual void | Clear (int color)=0 |
Clear backbuffer. | |
virtual void | ClearAll (int color)=0 |
Clear all video pages. | |
virtual void | DrawLine (float x1, float y1, float x2, float y2, int color)=0 |
Draw a line. | |
virtual void | DrawBox (int x, int y, int w, int h, int color)=0 |
Draw a box. | |
virtual bool | ClipLine (float &x1, float &y1, float &x2, float &y2, int xmin, int ymin, int xmax, int ymax)=0 |
Clip a line against given rectangle. More... | |
virtual void | DrawPixel (int x, int y, int color)=0 |
Draw a pixel. | |
virtual unsigned char* | GetPixelAt (int x, int y)=0 |
Returns the address of the pixel at the specified (x, y) coordinates. | |
virtual void | GetPixel (int x, int y, UByte &oR, UByte &oG, UByte &oB)=0 |
Query pixel R,G,B at given screen location. | |
virtual csImageArea* | SaveArea (int x, int y, int w, int h)=0 |
Save a subarea of screen and return a handle to saved buffer. More... | |
virtual void | RestoreArea (csImageArea *Area, bool Free)=0 |
Restore a subarea of screen saved with SaveArea(). | |
virtual void | FreeArea (csImageArea *Area)=0 |
Free storage allocated for a subarea of screen. | |
virtual void | Write (iFont *font, int x, int y, int fg, int bg, const char *str)=0 |
Write a text string into the back buffer. | |
virtual void | AllowResize (bool iAllow)=0 |
Enable/disable canvas resizing. | |
virtual bool | Resize (int w, int h)=0 |
Resize the canvas. | |
virtual iFontServer* | GetFontServer ()=0 |
Get the active font server (does not do IncRef()). | |
virtual bool | PerformExtension (char const *command,...)=0 |
Perform a system specific exension.<. More... | |
virtual bool | PerformExtensionV (char const *command, va_list)=0 |
Perform a system specific exension.<. More... | |
virtual iImage* | ScreenShot ()=0 |
Do a screenshot: return a new iImage object. | |
virtual iGraphics2D* | CreateOffScreenCanvas (int width, int height, void *buffer, bool alone_hint, csPixelFormat *ipfmt, csRGBpixel *palette=NULL, int pal_size=0)=0 |
Create an Off Screen Canvas. | |
virtual iNativeWindow* | GetNativeWindow ()=0 |
Get the native window corresponding with this canvas. More... | |
virtual bool | GetFullScreen ()=0 |
Returns 'true' if the program is being run full-screen. | |
virtual void | SetFullScreen (bool b)=0 |
Change the fullscreen state of the canvas. | |
virtual bool | SetMousePosition (int x, int y)=0 |
Set mouse position (relative to top-left of CS window). | |
virtual bool | SetMouseCursor (csMouseCursorID iShape)=0 |
Set mouse cursor to one of predefined shape classes (see csmcXXX enum above). More... |
The 2D renderer is responsible for all 2D operations such as creating the window, switching pages, returning pixel format and so on.
|
This routine should be called before any draw operations. It should return true if graphics context is ready. |
|
Clip a line against given rectangle. Function returns true if line is not visible. |
|
Get the native window corresponding with this canvas. If this is an off-screen canvas then this will return NULL. |
|
Return the number of palette entries that can be modified. This should return 0 if there is no palette (true color displays). This function is equivalent to the PalEntries field that you get from GetPixelFormat. It is just a little bit easier to obtain this way. |
|
Return the number of bytes for every pixel. This function is equivalent to the PixelBytes field that you get from GetPixelFormat. |
|
Perform a system specific exension.<. p> The command is a string; any arguments may follow. There is no way to guarantee the uniquiness of commands, so please try to use descriptive command names rather than "a", "b" and so on... |
|
Perform a system specific exension.<. p> Just like PerformExtension() except that the command arguments are passed as a `va_list'. |
|
Flip video pages (or dump backbuffer into framebuffer). The area parameter is only a hint to the canvas driver. Changes outside the rectangle may or may not be printed as well. |
|
Save a subarea of screen and return a handle to saved buffer. Storage is allocated in this call, you should either FreeArea() the handle after usage or RestoreArea () it. |
|
Set mouse cursor to one of predefined shape classes (see csmcXXX enum above). If a specific mouse cursor shape is not supported, return 'false'; otherwise return 'true'. If system supports it the cursor should be set to its nearest system equivalent depending on iShape argument and the routine should return "true". |