csTexture Class Reference
A simple texture. More...
#include <csplugincommon/render3d/txtmgr.h>
Public Member Functions | |
csTexture (csTextureHandle *Parent) | |
Create a csTexture object. | |
virtual | ~csTexture () |
Destroy the texture object. | |
int | get_size () |
Query image size (alas we can't do (h << shf_w)). | |
Protected Member Functions | |
void | compute_masks () |
Compute shf_x and and_x values. | |
Protected Attributes | |
csTextureHandle * | parent |
The parent csTextureHandle object. | |
int | w |
Width and height. | |
int | h |
Width and height. | |
int | shf_w |
log2(width) and log2(height) | |
int | shf_h |
log2(width) and log2(height) | |
int | and_w |
(1 << log2(width)) - 1 and (1 << log2(height)) - 1 | |
int | and_h |
(1 << log2(width)) - 1 and (1 << log2(height)) - 1 |
Detailed Description
A simple texture.Every csTextureHandle contains several csTexture objects. Every csTexture is just a single image and all associated parameters - width, height, shifts and so on. For performance reasons textures are allowed to be only power-of-two sizes (both horizontal and vertical). This allows us to use simple binary shift/and instead of mul/div. It is the responsability of csTextureHandle to resize textures if they do not fulfil this requirement.
The actual csTexture class does not implement any storage for the actual texture data. Every 3D driver should derive a own class from csTexture and implement appropiate backing store (for example, most hardware drivers will store the texture as a texture handle).
Definition at line 212 of file txtmgr.h.
Constructor & Destructor Documentation
|
Create a csTexture object.
|
|
Destroy the texture object.
|
Member Function Documentation
|
Compute shf_x and and_x values.
|
|
Query image size (alas we can't do (h << shf_w)).
Definition at line 246 of file txtmgr.h. References w. |
Member Data Documentation
|
(1 << log2(width)) - 1 and (1 << log2(height)) - 1
|
|
(1 << log2(width)) - 1 and (1 << log2(height)) - 1
|
|
Width and height.
|
|
The parent csTextureHandle object.
|
|
log2(width) and log2(height)
|
|
log2(width) and log2(height)
|
|
Width and height.
Definition at line 218 of file txtmgr.h. Referenced by get_size(). |
The documentation for this class was generated from the following file:
- csplugincommon/render3d/txtmgr.h
Generated for Crystal Space by doxygen 1.3.9.1