C# Class Terrarium.Renderer.DirectX.DirectDrawSurface

Managed Wrapper for a DirectX7 DirectDraw Surface.
Inheritance: IGraphicsSurface
显示文件 Open project: eugeniomiro/Terrarium Class Usage Examples

Private Properties

Property Type Description
CountBits int
CreateSurface void
DirectDrawSurface System
DirectDrawSurface System
DirectDrawSurface System
DirectDrawSurface System
GenerateColorKey DDCOLORKEY

Public Methods

Method Description
Blt ( Rectangle &destRect, IGraphicsSurface surface, Rectangle &srcRect, BltFlags flags ) : void

BltColorFill ( Rectangle &rect, int fillvalue ) : void

BltFast ( int x, int y, IGraphicsSurface surface, Rectangle &rectangle, BltFastFlags flags ) : void

DirectDrawSurface ( String imagePath ) : System

Create a new surface given an image path

DirectDrawSurface ( int x, int y ) : System

Creates a new DirectDrawSurface given a width and height.

GetBackBufferSurface ( ) : IGraphicsSurface

GetDC ( ) : IntPtr

IsLost ( ) : int

ReleaseDC ( IntPtr handle ) : void

RestoreSurface ( ) : void

Recreate the surface in the instance that the image memory is lost do to a video mode switch.

SetForeColor ( int color ) : void

Private Methods

Method Description
CountBits ( int number ) : int

Helper function for counting bits used when creating transparency keys.

CreateSurface ( ) : void

Helper function used to complete initialization of a surface.

DirectDrawSurface ( ) : System

Static constructor used to intialize static surface description fields.

DirectDrawSurface ( DDSURFACEDESC2 surfaceDescription ) : System

Create a new surface given a surface description.

DirectDrawSurface ( DirectDrawSurface7 directDrawSurface ) : System

Initialize a new surface based on a previously created surface

DirectDrawSurface ( String imagePath, DDSURFACEDESC2 surfaceDescription ) : System

Create a new surface from an image and a surface description.

GenerateColorKey ( byte r, byte g, byte b ) : DDCOLORKEY

Attempts to generate a transparency key from an r,g,b byte color.

Method Details

Blt() public method

public Blt ( Rectangle &destRect, IGraphicsSurface surface, Rectangle &srcRect, BltFlags flags ) : void
destRect System.Drawing.Rectangle
surface IGraphicsSurface
srcRect System.Drawing.Rectangle
flags BltFlags
return void

BltColorFill() public method

public BltColorFill ( Rectangle &rect, int fillvalue ) : void
rect System.Drawing.Rectangle
fillvalue int
return void

BltFast() public method

public BltFast ( int x, int y, IGraphicsSurface surface, Rectangle &rectangle, BltFastFlags flags ) : void
x int
y int
surface IGraphicsSurface
rectangle System.Drawing.Rectangle
flags BltFastFlags
return void

DirectDrawSurface() public method

Create a new surface given an image path
public DirectDrawSurface ( String imagePath ) : System
imagePath String Path to an image file.
return System

DirectDrawSurface() public method

Creates a new DirectDrawSurface given a width and height.
public DirectDrawSurface ( int x, int y ) : System
x int The width of the surface.
y int The height of the surface.
return System

GetBackBufferSurface() public method

public GetBackBufferSurface ( ) : IGraphicsSurface
return IGraphicsSurface

GetDC() public method

public GetDC ( ) : IntPtr
return System.IntPtr

IsLost() public method

public IsLost ( ) : int
return int

ReleaseDC() public method

public ReleaseDC ( IntPtr handle ) : void
handle System.IntPtr
return void

RestoreSurface() public method

Recreate the surface in the instance that the image memory is lost do to a video mode switch.
public RestoreSurface ( ) : void
return void

SetForeColor() public method

public SetForeColor ( int color ) : void
color int
return void