C# Класс TexLib.TexUtil

The TexUtil class is released under the MIT-license. /Olof Bjarnason
Показать файл Открыть проект

Открытые методы

Метод Описание
CreateRGBATexture ( int width, int height, byte rgba ) : int

Create a translucent OpenGL texture object from given byte-array of r,g,b,a-triplets. See CreateRGBTexture for more info.

CreateRGBTexture ( int width, int height, byte rgb ) : int

Create an opaque OpenGL texture object from a given byte-array of r,g,b-triplets. Make sure width and height is 1, 2, .., 32, 64, 128, 256 and so on in size since all 3d graphics cards support those dimensions. Not necessarily square. Don't forget to call GL.DeleteTexture(int) when you don't need the texture anymore (eg. when switching levels in your game).

CreateTextureFromBitmap ( Bitmap bitmap ) : int

Create an OpenGL texture (translucent or opaque) from a given Bitmap. 24- and 32-bit bitmaps supported.

CreateTextureFromFile ( string path ) : int

Create an OpenGL texture (translucent or opaque) by loading a bitmap from file. 24- and 32-bit bitmaps supported.

InitTexturing ( ) : void

Initialize OpenGL state to enable alpha-blended texturing. Disable again with GL.Disable(EnableCap.Texture2D). Call this before drawing any texture, when you boot your application, eg. in OnLoad() of GameWindow or Form_Load() if you're building a WinForm app.

Приватные методы

Метод Описание
CreateTexture ( int width, int height, bool alpha, byte bytes ) : int
GiveMeATexture ( ) : int
SetParameters ( ) : void
Upload ( int width, int height, bool alpha, byte bytes ) : void

Описание методов

CreateRGBATexture() публичный статический Метод

Create a translucent OpenGL texture object from given byte-array of r,g,b,a-triplets. See CreateRGBTexture for more info.
public static CreateRGBATexture ( int width, int height, byte rgba ) : int
width int
height int
rgba byte
Результат int

CreateRGBTexture() публичный статический Метод

Create an opaque OpenGL texture object from a given byte-array of r,g,b-triplets. Make sure width and height is 1, 2, .., 32, 64, 128, 256 and so on in size since all 3d graphics cards support those dimensions. Not necessarily square. Don't forget to call GL.DeleteTexture(int) when you don't need the texture anymore (eg. when switching levels in your game).
public static CreateRGBTexture ( int width, int height, byte rgb ) : int
width int
height int
rgb byte
Результат int

CreateTextureFromBitmap() публичный статический Метод

Create an OpenGL texture (translucent or opaque) from a given Bitmap. 24- and 32-bit bitmaps supported.
public static CreateTextureFromBitmap ( Bitmap bitmap ) : int
bitmap System.Drawing.Bitmap
Результат int

CreateTextureFromFile() публичный статический Метод

Create an OpenGL texture (translucent or opaque) by loading a bitmap from file. 24- and 32-bit bitmaps supported.
public static CreateTextureFromFile ( string path ) : int
path string
Результат int

InitTexturing() публичный статический Метод

Initialize OpenGL state to enable alpha-blended texturing. Disable again with GL.Disable(EnableCap.Texture2D). Call this before drawing any texture, when you boot your application, eg. in OnLoad() of GameWindow or Form_Load() if you're building a WinForm app.
public static InitTexturing ( ) : void
Результат void