AgateLib.ImplementationBase.DisplayImpl Class Reference

Abstract base class for implementing the Display object. More...

Inheritance diagram for AgateLib.ImplementationBase.DisplayImpl:

AgateLib.ImplementationBase.DriverImplBase

List of all members.

Public Member Functions

abstract DisplayWindowImpl CreateDisplayWindow (CreateWindowParams windowParams)
 Creates a DisplayWindowImpl derived object.
abstract SurfaceImpl CreateSurface (string fileName)
 Creates a SurfaceImpl derived object.
abstract SurfaceImpl CreateSurface (Stream fileStream)
 Creates a SurfaceImpl derived object from a stream containing the file contents.
abstract SurfaceImpl CreateSurface (Size surfaceSize)
 Creates a SurfaceImpl derived object.
SurfaceImpl CreateSurface (int width, int height)
 Creates a SurfaceImpl derived object. Forwards the call to CreateSurface(Size).
abstract FontSurfaceImpl CreateFont (string fontFamily, float sizeInPoints, FontStyle style)
 Creates a FontSurfaceImpl derived object.
abstract FontSurfaceImpl CreateFont (BitmapFontOptions bitmapOptions)
 Creates a BitmapFontImpl object from the specified options.
void BeginFrame ()
 Must be called at the start of each frame.
void EndFrame ()
 A version of EndFrame must be called at the end of each frame. This version allows the caller to indicate to the implementation whether or not it is preferred to wait for the vertical blank to do the drawing.
void CheckInFrame (string functionName)
 Checks to see whether or not we are currently inside a BeginFrame..EndFrame block, and throws an exception if we are not. This is only meant to be called from functions which must operate between these calls.
void SetDeltaTime (double deltaTime)
 Provides a means to set the value returned by DeltaTime.
abstract void SetClipRect (Rectangle newClipRect)
 Set the current clipping rect.
abstract void PushClipRect (Rectangle newClipRect)
 Pushes a clip rect onto the clip rect stack.
abstract void PopClipRect ()
 Pops the clip rect and restores the previous clip rect.
virtual void Clear ()
 Clears the buffer to black.
abstract void Clear (Color color)
 Clears the buffer to the specified color.
abstract void Clear (Color color, Rectangle dest)
 Clears a region of the buffer to the specified color.
virtual void DrawEllipse (Rectangle rect, Color color)
 Draws an ellipse by making a bunch of connected lines.
abstract void DrawLine (int x1, int y1, int x2, int y2, Color color)
 Draws a line between the two specified end-points.
abstract void DrawLine (Point a, Point b, Color color)
 Draws a line between the two specified endpoints.
virtual void DrawLines (Point[] pt, Color color)
 Draws a bunch of connected points.
virtual void DrawLineSegments (Point[] pt, Color color)
 Draws a bunch of unconnected lines.

Info for developers: pt should be an array whose length is even.

.

abstract void DrawRect (Rectangle rect, Color color)
 Draws the outline of a rectangle.
abstract void DrawRect (RectangleF rect, Color color)
 Draws the outline of a rectangle.
abstract void FillRect (Rectangle rect, Color color)
 Draws a filled rectangle.
abstract void FillRect (Rectangle rect, Gradient color)
 Draws a filled rectangle with a gradient.
abstract void FillRect (RectangleF rect, Color color)
 Draws a filled rectangle.
abstract void FillRect (RectangleF rect, Gradient color)
 Draws a filled rectangle with a gradient.
virtual Surface BuildPackedSurface (Size size, SurfacePacker.RectPacker< Surface > packedRects)
 Builds a surface of the specified size, using the information generated by the SurfacePacker.
virtual ScreenMode[] EnumScreenModes ()
 Enumerates a list of screen modes.
abstract void FlushDrawBuffer ()
 Flushes the 2D draw buffer, if applicable.
abstract void SetOrthoProjection (Rectangle region)
 Sets the boundary coordinates of the window.
abstract void DoLighting (LightManager lights)
 Gets all the light settings from the LightManager.

Protected Member Functions

abstract void OnRenderTargetChange (IRenderTarget oldRenderTarget)
 Event raised when the current render target is changed.
abstract void OnRenderTargetResize ()
 Event raised when the render target is resized.
abstract void OnBeginFrame ()
 Called by BeginFrame to let the driver know to do its setup stuff for starting the next render pass.
abstract void OnEndFrame ()
 Called by EndFrame to let the driver know that it's time to swap buffers or whatever is required to finish rendering the frame.
abstract internal void ProcessEvents ()
 Processes pending events.
virtual internal void SavePixelBuffer (PixelBuffer pixelBuffer, string filename, ImageFileFormat format)
abstract internal
AgateLib.PlatformSpecific.IPlatformServices 
GetPlatformServices ()
 Override to return an object implementing IPlatformServices. This object will provide basic services that are not available in the .NET platform (high precision timing, etc.).

Properties

IRenderTarget RenderTarget [get, set]
 Gets or sets the current render target.
abstract PixelFormat DefaultSurfaceFormat [get]
 The pixelformat that created surfaces should use.
double AlphaThreshold [get, set]
 Gets or sets the threshold value for alpha transparency below which pixels are considered completely transparent, and may not be drawn.
double DeltaTime [get]
 Gets the amount of time in milliseconds that has passed between this frame and the last one.
double FramesPerSecond [get]
 Gets the framerate.
abstract Size MaxSurfaceSize [get]
 Returns the maximum size a surface object can be.
virtual bool VSync [get, set]
 Gets or sets VSync flag. There is no need to call base.VSync if overriding this member.
abstract IDisplayCaps Caps [get]
 Gets the capabilities of the Display object.
virtual internal bool IsAppIdle [get]
 Returns true if the application is idle and processing of events can be skipped. Base method just returns false to force processing of events at every frame.


Detailed Description

Abstract base class for implementing the Display object.


Member Function Documentation

void AgateLib.ImplementationBase.DisplayImpl.BeginFrame (  ) 

Must be called at the start of each frame.

virtual Surface AgateLib.ImplementationBase.DisplayImpl.BuildPackedSurface ( Size  size,
SurfacePacker.RectPacker< Surface packedRects 
) [virtual]

Builds a surface of the specified size, using the information generated by the SurfacePacker.

Parameters:
size 
packedRects 
Returns:

void AgateLib.ImplementationBase.DisplayImpl.CheckInFrame ( string  functionName  ) 

Checks to see whether or not we are currently inside a BeginFrame..EndFrame block, and throws an exception if we are not. This is only meant to be called from functions which must operate between these calls.

Parameters:
functionName The name of the calling function, for debugging purposes.

abstract void AgateLib.ImplementationBase.DisplayImpl.Clear ( Color  color,
Rectangle  dest 
) [pure virtual]

Clears a region of the buffer to the specified color.

Parameters:
color 
dest 

abstract void AgateLib.ImplementationBase.DisplayImpl.Clear ( Color  color  )  [pure virtual]

Clears the buffer to the specified color.

Parameters:
color 

virtual void AgateLib.ImplementationBase.DisplayImpl.Clear (  )  [virtual]

Clears the buffer to black.

abstract DisplayWindowImpl AgateLib.ImplementationBase.DisplayImpl.CreateDisplayWindow ( CreateWindowParams  windowParams  )  [pure virtual]

Creates a DisplayWindowImpl derived object.

Parameters:
windowParams 
Returns:

abstract FontSurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateFont ( BitmapFontOptions  bitmapOptions  )  [pure virtual]

Creates a BitmapFontImpl object from the specified options.

Parameters:
bitmapOptions 
Returns:

abstract FontSurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateFont ( string  fontFamily,
float  sizeInPoints,
FontStyle  style 
) [pure virtual]

Creates a FontSurfaceImpl derived object.

Parameters:
fontFamily 
sizeInPoints 
style 
Returns:

SurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateSurface ( int  width,
int  height 
)

Creates a SurfaceImpl derived object. Forwards the call to CreateSurface(Size).

abstract SurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateSurface ( Size  surfaceSize  )  [pure virtual]

Creates a SurfaceImpl derived object.

abstract SurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateSurface ( Stream  fileStream  )  [pure virtual]

Creates a SurfaceImpl derived object from a stream containing the file contents.

Parameters:
fileStream 
Returns:

abstract SurfaceImpl AgateLib.ImplementationBase.DisplayImpl.CreateSurface ( string  fileName  )  [pure virtual]

Creates a SurfaceImpl derived object.

abstract void AgateLib.ImplementationBase.DisplayImpl.DoLighting ( LightManager  lights  )  [pure virtual]

Gets all the light settings from the LightManager.

Parameters:
lights 

virtual void AgateLib.ImplementationBase.DisplayImpl.DrawEllipse ( Rectangle  rect,
Color  color 
) [virtual]

Draws an ellipse by making a bunch of connected lines.

Info for developers: The base class implements this by calculating points on the circumference of the ellipse, then making a call to DrawLines.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.DrawLine ( Point  a,
Point  b,
Color  color 
) [pure virtual]

Draws a line between the two specified endpoints.

Parameters:
a 
b 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.DrawLine ( int  x1,
int  y1,
int  x2,
int  y2,
Color  color 
) [pure virtual]

Draws a line between the two specified end-points.

Parameters:
x1 
y1 
x2 
y2 
color 

virtual void AgateLib.ImplementationBase.DisplayImpl.DrawLines ( Point[]  pt,
Color  color 
) [virtual]

Draws a bunch of connected points.

Info for developers: The base class implements this by making several calls to DrawLine. You may want to override this one to minimize state changes.

Parameters:
pt 
color 

virtual void AgateLib.ImplementationBase.DisplayImpl.DrawLineSegments ( Point[]  pt,
Color  color 
) [virtual]

Draws a bunch of unconnected lines.

Info for developers: pt should be an array whose length is even.

.

Parameters:
pt 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.DrawRect ( RectangleF  rect,
Color  color 
) [pure virtual]

Draws the outline of a rectangle.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.DrawRect ( Rectangle  rect,
Color  color 
) [pure virtual]

Draws the outline of a rectangle.

Parameters:
rect 
color 

void AgateLib.ImplementationBase.DisplayImpl.EndFrame (  ) 

A version of EndFrame must be called at the end of each frame. This version allows the caller to indicate to the implementation whether or not it is preferred to wait for the vertical blank to do the drawing.

virtual ScreenMode [] AgateLib.ImplementationBase.DisplayImpl.EnumScreenModes (  )  [virtual]

Enumerates a list of screen modes.

Returns:

abstract void AgateLib.ImplementationBase.DisplayImpl.FillRect ( RectangleF  rect,
Gradient  color 
) [pure virtual]

Draws a filled rectangle with a gradient.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.FillRect ( RectangleF  rect,
Color  color 
) [pure virtual]

Draws a filled rectangle.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.FillRect ( Rectangle  rect,
Gradient  color 
) [pure virtual]

Draws a filled rectangle with a gradient.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.FillRect ( Rectangle  rect,
Color  color 
) [pure virtual]

Draws a filled rectangle.

Parameters:
rect 
color 

abstract void AgateLib.ImplementationBase.DisplayImpl.FlushDrawBuffer (  )  [pure virtual]

Flushes the 2D draw buffer, if applicable.

abstract internal AgateLib.PlatformSpecific.IPlatformServices AgateLib.ImplementationBase.DisplayImpl.GetPlatformServices (  )  [protected, pure virtual]

Override to return an object implementing IPlatformServices. This object will provide basic services that are not available in the .NET platform (high precision timing, etc.).

Returns:

abstract void AgateLib.ImplementationBase.DisplayImpl.OnBeginFrame (  )  [protected, pure virtual]

Called by BeginFrame to let the driver know to do its setup stuff for starting the next render pass.

abstract void AgateLib.ImplementationBase.DisplayImpl.OnEndFrame (  )  [protected, pure virtual]

Called by EndFrame to let the driver know that it's time to swap buffers or whatever is required to finish rendering the frame.

abstract void AgateLib.ImplementationBase.DisplayImpl.OnRenderTargetChange ( IRenderTarget  oldRenderTarget  )  [protected, pure virtual]

Event raised when the current render target is changed.

Parameters:
oldRenderTarget 

abstract void AgateLib.ImplementationBase.DisplayImpl.OnRenderTargetResize (  )  [protected, pure virtual]

Event raised when the render target is resized.

abstract void AgateLib.ImplementationBase.DisplayImpl.PopClipRect (  )  [pure virtual]

Pops the clip rect and restores the previous clip rect.

abstract internal void AgateLib.ImplementationBase.DisplayImpl.ProcessEvents (  )  [protected, pure virtual]

Processes pending events.

abstract void AgateLib.ImplementationBase.DisplayImpl.PushClipRect ( Rectangle  newClipRect  )  [pure virtual]

Pushes a clip rect onto the clip rect stack.

Parameters:
newClipRect 

virtual internal void AgateLib.ImplementationBase.DisplayImpl.SavePixelBuffer ( PixelBuffer  pixelBuffer,
string  filename,
ImageFileFormat  format 
) [protected, virtual]

Parameters:
pixelBuffer 
filename 
format 

abstract void AgateLib.ImplementationBase.DisplayImpl.SetClipRect ( Rectangle  newClipRect  )  [pure virtual]

Set the current clipping rect.

Parameters:
newClipRect 

void AgateLib.ImplementationBase.DisplayImpl.SetDeltaTime ( double  deltaTime  ) 

Provides a means to set the value returned by DeltaTime.

Parameters:
deltaTime 

abstract void AgateLib.ImplementationBase.DisplayImpl.SetOrthoProjection ( Rectangle  region  )  [pure virtual]

Sets the boundary coordinates of the window.

Parameters:
region 


Property Documentation

double AgateLib.ImplementationBase.DisplayImpl.AlphaThreshold [get, set]

Gets or sets the threshold value for alpha transparency below which pixels are considered completely transparent, and may not be drawn.

abstract IDisplayCaps AgateLib.ImplementationBase.DisplayImpl.Caps [get]

Gets the capabilities of the Display object.

abstract PixelFormat AgateLib.ImplementationBase.DisplayImpl.DefaultSurfaceFormat [get]

The pixelformat that created surfaces should use.

double AgateLib.ImplementationBase.DisplayImpl.DeltaTime [get]

Gets the amount of time in milliseconds that has passed between this frame and the last one.

double AgateLib.ImplementationBase.DisplayImpl.FramesPerSecond [get]

Gets the framerate.

virtual internal bool AgateLib.ImplementationBase.DisplayImpl.IsAppIdle [get, protected]

Returns true if the application is idle and processing of events can be skipped. Base method just returns false to force processing of events at every frame.

abstract Size AgateLib.ImplementationBase.DisplayImpl.MaxSurfaceSize [get]

Returns the maximum size a surface object can be.

IRenderTarget AgateLib.ImplementationBase.DisplayImpl.RenderTarget [get, set]

Gets or sets the current render target.

virtual bool AgateLib.ImplementationBase.DisplayImpl.VSync [get, set]

Gets or sets VSync flag. There is no need to call base.VSync if overriding this member.


The documentation for this class was generated from the following file:
AgateLib
Awesome Game and Tool Engine Library
SourceForge.net Logo