AgateLib.DisplayLib.DisplayWindow Class Reference

A class representing a screen region which is used as a RenderTarget. More...

Inheritance diagram for AgateLib.DisplayLib.DisplayWindow:

AgateLib.DisplayLib.IRenderTarget

List of all members.

Public Member Functions

 DisplayWindow (Resources.AgateResourceCollection resources, string name)
 Constructs a DisplayWindow from a resource.
 DisplayWindow (CreateWindowParams windowParams)
 Creates a DisplayWindow object using the specified CreateWindowParams to create the window.
 DisplayWindow (object renderTarget)
 Creates a DisplayWindow object using the specified System.Windows.Forms.Control object as a render context. A DisplayWindow made in this manner cannot be made into a full-screen DisplayWindow.
 DisplayWindow (string title, int clientWidth, int clientHeight)
 Creates a DisplayWindow object by creating a windowed Form. By default, this window does not allow the user to resize it.
 DisplayWindow (string title, int clientWidth, int clientHeight, string iconFile)
 Creates a DisplayWindow object by creating a windowed Form. By default, this window does not allow the user to resize it.
 DisplayWindow (string title, int clientWidth, int clientHeight, string iconFile, bool startFullscreen)
 Creates a DisplayWindow object by creating a windowed or fullscreen Form. By default, this window does not allow the user to resize it.
 DisplayWindow (string title, int clientWidth, int clientHeight, string iconFile, bool startFullscreen, bool allowResize)
 Creates a DisplayWindow object by creating a windowed or fullscreen Form.
 DisplayWindow (string title, int clientWidth, int clientHeight, bool startFullscreen)
 Creates a DisplayWindow object by creating a windowed or fullscreen Form. By default, this window does not allow the user to resize it.
 DisplayWindow (string title, int clientWidth, int clientHeight, bool startFullscreen, bool allowResize)
 Creates a DisplayWindow object by creating a windowed or fullscreen Form.
void Dispose ()
 Disposes of unmanaged resources.
void SetWindowed ()
 Sets the display to windowed. Does nothing if the display is already windowed. The DisplayWindow retains the same height and width as the previous full screen resolution.
void SetFullScreen ()
 Sets the display to a full screen Display. This overload uses the desktop resolution for the full-screen Display.
void SetFullScreen (int width, int height, int bpp)
 Sets the display to a full screen Display. The resolution chosen is driver/video card/monitor dependent, but it should be fairly close to values specified.

Static Public Member Functions

static DisplayWindow FromControl (object control)
static DisplayWindow CreateFromControl (object control)
 Creates a DisplayWindow object using the specified System.Windows.Forms.Control object as a render context. A DisplayWindow made in this manner cannot be made into a full-screen DisplayWindow.
static DisplayWindow CreateFullScreen (string title, int width, int height)
 Creates a DisplayWindow object which renders to the entire screen, setting the resolution to the value specified.
static DisplayWindow CreateWindowed (string title, int width, int height)
 Creates a DisplayWindow object which generates a desktop window to render into. This overload creates a window which has the default icon and is not resizeable.
static DisplayWindow CreateWindowed (string title, int width, int height, bool allowResize, string iconFile)
 Creates a DisplayWindow object which generates a desktop window to render into.
static DisplayWindow CreateNoFrame (string title, int width, int height)
 Creates a DisplayWindow object which is a desktop window with no frame or titlebar.

Properties

bool IsClosed [get]
 Returns true if this DisplayWindow has been closed, either by a call to Dispose(), or perhaps the user clicked the close box in a form.
Size Size [get, set]
 Gets or sets the size of the client area in pixels.
int Width [get, set]
 Gets or sets the width of the client area in pixels.
int Height [get, set]
 Gets or sets the height of the client area in pixels.
Point MousePosition [get, set]
 Gets or sets the position of the cursor, in the client coordinates of the window.
DisplayWindowImpl Impl [get]
 Returns the DisplayWindowImpl object.
string Title [get, set]
 Gets or sets the title of the window.
bool IsFullScreen [get]
 Returns true if this window is displayed fullscreen.

Events

EventHandler Resize
 Event raised when the window is resized by the user.


Detailed Description

A class representing a screen region which is used as a RenderTarget.

Creating a DisplayWindow can be done in two ways. By specifying a title and width and height, the DisplayWindow will create and manage a window.

Alternatively, a control may be specified to render into.


Constructor & Destructor Documentation

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( Resources.AgateResourceCollection  resources,
string  name 
)

Constructs a DisplayWindow from a resource.

Parameters:
resources 
name 

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( CreateWindowParams  windowParams  ) 

Creates a DisplayWindow object using the specified CreateWindowParams to create the window.

Parameters:
windowParams 

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( object  renderTarget  ) 

Creates a DisplayWindow object using the specified System.Windows.Forms.Control object as a render context. A DisplayWindow made in this manner cannot be made into a full-screen DisplayWindow.

[Experimental - The API may be changed in the future.]

Parameters:
renderTarget Windows.Forms control which should be used as the render target.

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight 
)

Creates a DisplayWindow object by creating a windowed Form. By default, this window does not allow the user to resize it.

Parameters:
title 
clientWidth 
clientHeight 

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight,
string  iconFile 
)

Creates a DisplayWindow object by creating a windowed Form. By default, this window does not allow the user to resize it.

Parameters:
title Title of the window.
clientWidth Width of the drawing area in pixels.
clientHeight Height of the drawing area in pixels.
iconFile File name of a Win32 .ico file to use for the window icon. Pass null or "" to not use an icon.

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight,
string  iconFile,
bool  startFullscreen 
)

Creates a DisplayWindow object by creating a windowed or fullscreen Form. By default, this window does not allow the user to resize it.

Parameters:
title Title of the window.
clientWidth Width of the drawing area in pixels.
clientHeight Height of the drawing area in pixels.
iconFile File name of a Win32 .ico file to use for the window icon.
startFullscreen True to start as a full screen window.

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight,
string  iconFile,
bool  startFullscreen,
bool  allowResize 
)

Creates a DisplayWindow object by creating a windowed or fullscreen Form.

Parameters:
title Title of the window.
clientWidth Width of the drawing area in pixels.
clientHeight Height of the drawing area in pixels.
iconFile File name of a Win32 .ico file to use for the window icon.
startFullscreen True to start as a full screen window.
allowResize True to allow the user to manually resize the window by dragging the border.

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight,
bool  startFullscreen 
)

Creates a DisplayWindow object by creating a windowed or fullscreen Form. By default, this window does not allow the user to resize it.

Deprecated. Use an overload which includes the icon File argument.

Parameters:
title Title of the window.
clientWidth Width of the drawing area in pixels.
clientHeight Height of the drawing area in pixels.
startFullscreen True to start as a full screen window.

AgateLib.DisplayLib.DisplayWindow.DisplayWindow ( string  title,
int  clientWidth,
int  clientHeight,
bool  startFullscreen,
bool  allowResize 
)

Creates a DisplayWindow object by creating a windowed or fullscreen Form.

Parameters:
title 
clientWidth 
clientHeight 
startFullscreen 
allowResize 


Member Function Documentation

static DisplayWindow AgateLib.DisplayLib.DisplayWindow.CreateFromControl ( object  control  )  [static]

Creates a DisplayWindow object using the specified System.Windows.Forms.Control object as a render context. A DisplayWindow made in this manner cannot be made into a full-screen DisplayWindow.

Calling this function is equivalent to calling new DisplayWindow(CreateWindowParams.FromControl(control)).

Parameters:
control Windows.Forms control which should be used as the render target.

static DisplayWindow AgateLib.DisplayLib.DisplayWindow.CreateFullScreen ( string  title,
int  width,
int  height 
) [static]

Creates a DisplayWindow object which renders to the entire screen, setting the resolution to the value specified.

Parameters:
title 
width 
height 
bpp 
Returns:

static DisplayWindow AgateLib.DisplayLib.DisplayWindow.CreateNoFrame ( string  title,
int  width,
int  height 
) [static]

Creates a DisplayWindow object which is a desktop window with no frame or titlebar.

Parameters:
title 
width 
height 
Returns:

static DisplayWindow AgateLib.DisplayLib.DisplayWindow.CreateWindowed ( string  title,
int  width,
int  height,
bool  allowResize,
string  iconFile 
) [static]

Creates a DisplayWindow object which generates a desktop window to render into.

Parameters:
title 
width 
height 
iconFile 
allowResize 
Returns:

static DisplayWindow AgateLib.DisplayLib.DisplayWindow.CreateWindowed ( string  title,
int  width,
int  height 
) [static]

Creates a DisplayWindow object which generates a desktop window to render into. This overload creates a window which has the default icon and is not resizeable.

Parameters:
title 
width 
height 
Returns:

void AgateLib.DisplayLib.DisplayWindow.Dispose (  ) 

Disposes of unmanaged resources.

void AgateLib.DisplayLib.DisplayWindow.SetFullScreen ( int  width,
int  height,
int  bpp 
)

Sets the display to a full screen Display. The resolution chosen is driver/video card/monitor dependent, but it should be fairly close to values specified.

This call is not guaranteed to work; some drivers (eg. GDI) don't support fullscreen displays. If this fails it returns without any error thrown. Check to see if it worked by examining IsFullScreen property.

Parameters:
width 
height 
bpp 

void AgateLib.DisplayLib.DisplayWindow.SetFullScreen (  ) 

Sets the display to a full screen Display. This overload uses the desktop resolution for the full-screen Display.

This call is not guaranteed to work; some drivers (eg. GDI) don't support fullscreen displays. If this fails it returns without any error thrown. Check to see if it worked by examining IsFullScreen property.

void AgateLib.DisplayLib.DisplayWindow.SetWindowed (  ) 

Sets the display to windowed. Does nothing if the display is already windowed. The DisplayWindow retains the same height and width as the previous full screen resolution.


Property Documentation

int AgateLib.DisplayLib.DisplayWindow.Height [get, set]

Gets or sets the height of the client area in pixels.

Implements AgateLib.DisplayLib.IRenderTarget.

DisplayWindowImpl AgateLib.DisplayLib.DisplayWindow.Impl [get]

Returns the DisplayWindowImpl object.

Implements AgateLib.DisplayLib.IRenderTarget.

bool AgateLib.DisplayLib.DisplayWindow.IsClosed [get]

Returns true if this DisplayWindow has been closed, either by a call to Dispose(), or perhaps the user clicked the close box in a form.

bool AgateLib.DisplayLib.DisplayWindow.IsFullScreen [get]

Returns true if this window is displayed fullscreen.

Point AgateLib.DisplayLib.DisplayWindow.MousePosition [get, set]

Gets or sets the position of the cursor, in the client coordinates of the window.

Size AgateLib.DisplayLib.DisplayWindow.Size [get, set]

Gets or sets the size of the client area in pixels.

Implements AgateLib.DisplayLib.IRenderTarget.

string AgateLib.DisplayLib.DisplayWindow.Title [get, set]

Gets or sets the title of the window.

int AgateLib.DisplayLib.DisplayWindow.Width [get, set]

Gets or sets the width of the client area in pixels.

Implements AgateLib.DisplayLib.IRenderTarget.


Event Documentation

EventHandler AgateLib.DisplayLib.DisplayWindow.Resize

Event raised when the window is resized by the user.

Implements AgateLib.DisplayLib.IRenderTarget.


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