CrystalSpace

Public API Reference

iGraphicsCanvas Struct Reference
[2D]

This is the interface for the graphics canvas. More...

#include <ivideo/canvas.h>

Inheritance diagram for iGraphicsCanvas:

List of all members.

Public Member Functions

virtual void AllowResize (bool iAllow)=0
 Enable/disable canvas resizing.
virtual bool CanResize ()=0
 Returns whether resizing is enabled for the canvas.
virtual void CanvasClose ()=0
 Close the canvas.
virtual bool CanvasOpen ()=0
 Open the canvas.
virtual bool CanvasResize (int w, int h)=0
 Resize the canvas.
virtual bool ForceCanvasResize (int w, int h)=0
 Resize the canvas.
virtual int GetColorDepth ()=0
 Return color depth of the framebuffer.
virtual void GetFramebufferDimensions (int &width, int &height)=0
 Get the dimensions of the framebuffer.
virtual bool GetFullScreen ()=0
 Returns 'true' if the program is being run full-screen.
virtual float GetGamma () const =0
 Get gamma value.
virtual const char * GetName () const =0
 Get the name of the canvas.
virtual iNativeWindowGetNativeWindow ()=0
 Get the native window corresponding with this canvas.
virtual void Print (csRect const *pArea)=0
 Flip video pages (or dump backbuffer into framebuffer).
virtual void SetFullScreen (bool b)=0
 Change the fullscreen state of the canvas.
virtual bool SetGamma (float gamma)=0
 Set gamma value (if supported by canvas).
virtual bool SetMouseCursor (iImage *image, const csRGBcolor *keycolor=0, int hotspot_x=0, int hotspot_y=0, csRGBcolor fg=csRGBcolor(255, 255, 255), csRGBcolor bg=csRGBcolor(0, 0, 0))=0
 Set mouse cursor using an image.
virtual bool SetMouseCursor (csMouseCursorID iShape)=0
 Set mouse cursor to one of predefined shape classes (see csmcXXX enum above).
virtual bool SetMousePosition (int x, int y)=0
 Set mouse position (relative to top-left of CS window).

Detailed Description

This is the interface for the graphics canvas.

graphics canvas is responsible for basic operations such as creating the window, returning pixel format and so on.

Main creators of instances implementing this interface:

Definition at line 53 of file canvas.h.


Member Function Documentation

virtual void iGraphicsCanvas::AllowResize ( bool  iAllow  )  [pure virtual]

Enable/disable canvas resizing.

virtual bool iGraphicsCanvas::CanResize (  )  [pure virtual]

Returns whether resizing is enabled for the canvas.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual void iGraphicsCanvas::CanvasClose (  )  [pure virtual]
virtual bool iGraphicsCanvas::CanvasOpen (  )  [pure virtual]
virtual bool iGraphicsCanvas::CanvasResize ( int  w,
int  h 
) [pure virtual]
virtual bool iGraphicsCanvas::ForceCanvasResize ( int  w,
int  h 
) [pure virtual]

Resize the canvas.

Ignores the "allow resizing" flag, so is useful when to programmatically resize the canvas while still preventing the user to resize it.

Remarks:
May nevertheless return false if the resizing fails for other reasons.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual int iGraphicsCanvas::GetColorDepth (  )  [pure virtual]

Return color depth of the framebuffer.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual void iGraphicsCanvas::GetFramebufferDimensions ( int &  width,
int &  height 
) [pure virtual]

Get the dimensions of the framebuffer.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual bool iGraphicsCanvas::GetFullScreen (  )  [pure virtual]

Returns 'true' if the program is being run full-screen.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual float iGraphicsCanvas::GetGamma (  )  const [pure virtual]

Get gamma value.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual const char* iGraphicsCanvas::GetName (  )  const [pure virtual]

Get the name of the canvas.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual iNativeWindow* iGraphicsCanvas::GetNativeWindow (  )  [pure virtual]

Get the native window corresponding with this canvas.

If this is an off-screen canvas then this will return 0.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual void iGraphicsCanvas::Print ( csRect const *  pArea  )  [pure virtual]

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.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual void iGraphicsCanvas::SetFullScreen ( bool  b  )  [pure virtual]

Change the fullscreen state of the canvas.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual bool iGraphicsCanvas::SetGamma ( float  gamma  )  [pure virtual]

Set gamma value (if supported by canvas).

By default this is 1. Smaller values are darker. If the canvas doesn't support gamma then this function will return false.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual bool iGraphicsCanvas::SetMouseCursor ( iImage image,
const csRGBcolor keycolor = 0,
int  hotspot_x = 0,
int  hotspot_y = 0,
csRGBcolor  fg = csRGBcolor(255, 255, 255),
csRGBcolor  bg = csRGBcolor(0, 0, 0) 
) [pure virtual]

Set mouse cursor using an image.

If the operation is unsupported, false is returned, otherwise true.

Remarks:
If setting a custom mouse is not supported no mouse cursor "emulation" is done in the canvas. You can use the custom cursor plugin (see iCursor) for automatic mouse cursor emulation in case the canvas doesn't support it, or do it yourself (after everything was drawn, draw the desired mouse cursor image at the current mouse cursor position).

On some platforms there are only monochrome pointers available. In this all black colors in the image will become the value of bg and all non-black colors will become fg. This behaviour can be disabled by setting the Video.SystemMouseCursor configuration key to rgbaonly.

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual bool iGraphicsCanvas::SetMouseCursor ( csMouseCursorID  iShape  )  [pure virtual]

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".

Implemented in CS::PluginCommon::CanvasCommonBase.

virtual bool iGraphicsCanvas::SetMousePosition ( int  x,
int  y 
) [pure virtual]

Set mouse position (relative to top-left of CS window).

Implemented in CS::PluginCommon::CanvasCommonBase.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1