C# Class Clandestine.Texture

显示文件 Open project: mrmikey/nes Class Usage Examples

Public Properties

Property Type Description
Filename string
TexPointer int
bitmap System.Drawing.Bitmap

Public Methods

Method Description
Destroy ( ) : void
DoDeferredTextureOperations ( ) : void
ForceDestroyAllTextures ( ) : void
GetTexture ( string name ) : Texture
SetTexture ( string name, Texture texture, bool makeCopy ) : void

Either changes the name of an existing texture (and it's entry in the global texture array), or creates a new texture sharing the data of the existing one but with a different name. (Bitmap object and GL graphics memory is shared.) This call is NOT necessary in ordinary usage! EVERY Texture gets put in the global texture array once created, even if the name assigned is just a Guid.

ALL Textures already exist in the global texture array! This call is NOT necessary in ordinary Texture usage! Textures created using the new Texture(Bitmap) constructor have a GUID assigned.

Texture ( Bitmap bitmap ) : System
Texture ( Bitmap bitmap, bool treatAsIndexed ) : System
Texture ( string bitmapFilename ) : System
Texture ( string identifier, Bitmap bitmap ) : System
Texture ( string identifier, Bitmap bitmap, bool treatAsIndexed ) : System
TextureExists ( string name ) : bool
createNewGlTexture ( ) : void

Private Methods

Method Description
ChromaKey32bppBitmap ( Bitmap bmp, Color chroma ) : void
ChromaKeyIfNecessary ( Bitmap bmp, bool treatAsIndexed ) : Bitmap
ConvertTo32bppBitmap ( Bitmap bmp ) : Bitmap
Texture ( ) : System
doDeferredOperations ( ) : void
doDestroy ( ) : void
resizeIfNecessary ( Bitmap bmpOriginal ) : Bitmap

Method Details

Destroy() public method

public Destroy ( ) : void
return void

DoDeferredTextureOperations() public static method

public static DoDeferredTextureOperations ( ) : void
return void

ForceDestroyAllTextures() public static method

public static ForceDestroyAllTextures ( ) : void
return void

GetTexture() public static method

public static GetTexture ( string name ) : Texture
name string
return Texture

SetTexture() public static method

Either changes the name of an existing texture (and it's entry in the global texture array), or creates a new texture sharing the data of the existing one but with a different name. (Bitmap object and GL graphics memory is shared.) This call is NOT necessary in ordinary usage! EVERY Texture gets put in the global texture array once created, even if the name assigned is just a Guid.
ALL Textures already exist in the global texture array! This call is NOT necessary in ordinary Texture usage! Textures created using the new Texture(Bitmap) constructor have a GUID assigned.
public static SetTexture ( string name, Texture texture, bool makeCopy ) : void
name string
texture Texture
makeCopy bool
return void

Texture() public method

public Texture ( Bitmap bitmap ) : System
bitmap System.Drawing.Bitmap
return System

Texture() public method

public Texture ( Bitmap bitmap, bool treatAsIndexed ) : System
bitmap System.Drawing.Bitmap
treatAsIndexed bool
return System

Texture() public method

public Texture ( string bitmapFilename ) : System
bitmapFilename string
return System

Texture() public method

public Texture ( string identifier, Bitmap bitmap ) : System
identifier string
bitmap System.Drawing.Bitmap
return System

Texture() public method

public Texture ( string identifier, Bitmap bitmap, bool treatAsIndexed ) : System
identifier string
bitmap System.Drawing.Bitmap
treatAsIndexed bool
return System

TextureExists() public static method

public static TextureExists ( string name ) : bool
name string
return bool

createNewGlTexture() public method

public createNewGlTexture ( ) : void
return void

Property Details

Filename public_oe property

public string Filename
return string

TexPointer public_oe property

public int TexPointer
return int

bitmap public_oe property

public Bitmap,System.Drawing bitmap
return System.Drawing.Bitmap