C# Class OpenBve.Textures

Show file Open project: leezer3/OpenBVE Class Usage Examples

Private Methods

Method Description
Deinitialize ( ) : void

Deinitializes the texture component.

GetNextFreeTexture ( ) : int

Gets the next free texture, resizing the base textures array if appropriate

GetNumberOfLoadedTextures ( ) : int

Gets the number of loaded textures.

GetNumberOfRegisteredTextures ( ) : int

Gets the number of registered textures.

Initialize ( ) : void

Initializes the texture component. A call to Deinitialize must be made when terminating the program.

LoadAllTextures ( ) : void

Loads all registered textures.

LoadTexture ( Texture handle, OpenGlTextureWrapMode wrap ) : bool

Loads the specified texture into OpenGL if not already loaded.

RegisterTexture ( Bitmap bitmap ) : Texture

Registeres a texture and returns a handle to the texture.

Be sure not to dispose of the bitmap after calling this function.

RegisterTexture ( Bitmap bitmap, OpenBveApi parameters ) : Texture

Registers a texture and returns a handle to the texture.

Be sure not to dispose of the bitmap after calling this function.

RegisterTexture ( OpenBveApi texture ) : Texture

Registers a texture and returns a handle to the texture.

RegisterTexture ( string path, OpenBveApi parameters, Texture &handle ) : bool

Registeres a texture and returns a handle to the texture.

RegisterTexture ( string path, Texture &handle ) : bool

Registeres a texture and returns a handle to the texture.

Resize ( OpenBveApi texture, int width, int height ) : OpenBveApi.Textures.Texture

Resizes the specified texture to the specified width and height and returns the result.

ResizeToPowerOfTwo ( OpenBveApi texture ) : OpenBveApi.Textures.Texture

Resizes the specified texture to a power of two size and returns the result.

RoundUpToPowerOfTwo ( int value ) : int

Takes a positive value and rounds it up to the next highest power of two.

SaveTexture ( string file, OpenBveApi texture ) : void

Saves a texture to a file.

The texture is always saved in PNG format.

UnloadAllTextures ( ) : void

Unloads all registered textures.

UnloadTexture ( Texture handle ) : void

Unloads the specified texture from OpenGL if loaded.