C# 클래스 TexLib.TexUtil

The TexUtil class is released under the MIT-license. /Olof Bjarnason
파일 보기 프로젝트 열기: LukaHorvat/Kento

공개 메소드들

메소드 설명
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