Class TglBitmap
Unit
glBitmap
Declaration
type TglBitmap = class(TObject)
Description
base class for all glBitmap classes. used to manage OpenGL texture objects all operations on a bitmap object must be done from the render thread
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
|
fID: GLuint; |
name of the OpenGL texture object
|
|
fTarget: GLuint; |
texture target (e.g. GL_TEXTURE_2D)
|
|
fDeleteTextureOnFree: Boolean; |
delete OpenGL texture object when this object is destroyed
|
|
fFilterMin: GLenum; |
min filter to apply to the texture
|
|
fFilterMag: GLenum; |
mag filter to apply to the texture
|
|
fWrapS: GLenum; |
texture wrapping for x axis
|
|
fWrapT: GLenum; |
texture wrapping for y axis
|
|
fWrapR: GLenum; |
texture wrapping for z axis
|
|
fAnisotropic: Integer; |
anisotropic level
|
|
fBorderColor: array[0..3] of Single; |
color of the texture border
|
|
fSwizzle: array[0..3] of GLenum; |
color channel swizzle
|
|
fCustomData: Pointer; |
user defined data
|
|
fCustomName: String; |
user defined name
|
|
fCustomNameW: WideString; |
user defined name
|
Methods
|
function GetWidth: Integer; virtual; |
Returns
the actual width of the texture |
|
function GetHeight: Integer; virtual; |
Returns
the actual height of the texture |
|
procedure SetCustomData(const aValue: Pointer); |
set a new value for fCustomData
|
|
procedure SetCustomName(const aValue: String); |
set a new value for fCustomName
|
|
procedure SetCustomNameW(const aValue: WideString); |
set a new value for fCustomNameW
|
|
procedure SetDeleteTextureOnFree(const aValue: Boolean); |
set new value for fDeleteTextureOnFree
|
|
procedure SetID(const aValue: Cardinal); |
set name of OpenGL texture object
|
|
procedure SetMipMap(const aValue: TglBitmapMipMap); |
set new value for fMipMap
|
|
procedure SetTarget(const aValue: Cardinal); |
set new value for target
|
|
procedure SetAnisotropic(const aValue: Integer); |
set new value for fAnisotrophic
|
|
procedure CreateID; |
create OpenGL texture object (delete exisiting object if exists)
|
|
procedure SetupParameters(); |
setup texture parameters
|
|
procedure AfterConstruction; override; |
this method is called after the constructor and sets the default values of this object
|
|
procedure BeforeDestruction; override; |
this method is called before the destructor and does some cleanup
|
|
procedure SetFilter(const aMin, aMag: GLenum); |
set new texture filer
Parameters
- aMin
- min filter
- aMag
- mag filter
|
|
procedure SetWrap( const S: GLenum = GL_CLAMP_TO_EDGE; const T: GLenum = GL_CLAMP_TO_EDGE; const R: GLenum = GL_CLAMP_TO_EDGE); |
set new texture wrapping
Parameters
- S
- texture wrapping for x axis
- T
- texture wrapping for y axis
- R
- texture wrapping for z axis
|
|
procedure SetSwizzle(const r, g, b, a: GLenum); |
set new swizzle
Parameters
- r
- swizzle for red channel
- g
- swizzle for green channel
- b
- swizzle for blue channel
- a
- swizzle for alpha channel
|
|
procedure Bind(const aEnableTextureUnit: Boolean = true); virtual; |
bind texture
Parameters
- aEnableTextureUnit
- enable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D))
|
|
procedure Unbind(const aDisableTextureUnit: Boolean = true); virtual; |
bind texture
Parameters
- aDisableTextureUnit
- disable texture unit for this texture (e.g. glEnable(GL_TEXTURE_2D))
|
|
procedure UploadData(const aDataObj: TglBitmapData; const aCheckSize: Boolean = true); virtual; |
upload texture data from given data object to video card
Parameters
- aData
- texture data object that contains the actual data
- aCheckSize
- check size before upload and throw exception if something is wrong
|
|
constructor Create; overload; |
constructor - creates an empty texture
|
|
constructor Create(const aData: TglBitmapData); overload; |
constructor - creates an texture object and uploads the given data
|
Properties
|
property Width: Integer read GetWidth; |
the actual width of the texture
|
|
property Height: Integer read GetHeight; |
the actual height of the texture
|
|
property ID: Cardinal read fID write SetID; |
name of the OpenGL texture object
|
|
property Target: Cardinal read fTarget write SetTarget; |
texture target (e.g. GL_TEXTURE_2D)
|
Generated by PasDoc 0.13.0 on 2014-12-24 04:27:09
|