Texture class
From Solid Graphics Wiki
| ||||||||||||
The Texture class represents a 2D raster image which is intended to be used as OpenGL texture.
Constructors
The only Texture class constructors are constructor without any parameters and copy constructor. The copy constructor is provided only for purpose of using Texture class as parameter to List template and should not be otherwise used. The copy constructor works only when the source texture is not yet loaded.
Fields
| Field name | Type | Description |
| sourceWidth | int | Width (in pixels) of the source image used to load the texture. This attribute is undefined/uninitialized if the texture is not "loaded" yet. Use the IsLoaded method to determine whether the texture is loaded. |
| sourceHeight | int | Height (in pixels) of the source image used to load the texture. This attribute is undefined/uninitialized if the texture is not "loaded" yet. |
| bytesPerPixel | int | Bytes per pixel used by the texture. If 3 then the texture is using 24bit, 8 bits per component RGB pixel format. If 4 then the texture is using 32-bit, 8 bits per component RGBA pixel format.
This attribute is undefined/uninitialized if the texture is not "loaded" yet. |
Methods
| Method name | Description |
| Load | Loads image from a file, memory, or application-attached-resource into OpenGL texture object. |
| IsLoaded | Returns true if the OpenGL texture object was successfully loaded. Otherwise returns false. |
| Clear | If the texture is loaded then the Clear method releases underlying OpenGL texture object. |
| MakeCurrent | The method internally calls OpenGL's glBindTexture function to make the texture current. Result of this method is undefined if the OpenGL texture object was not previously loaded sucessfully (the IsLoaded returns false). |
Operators
The class has no public operators defined.
See Also
SolidKit Library Documentation
