CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

csTexture Class Reference

A simple texture. More...

#include <csplugincommon/render3d/txtmgr.h>

List of all members.

Public Member Functions

 csTexture (csTextureHandle *Parent)
 Create a csTexture object.
int get_h_mask ()
int get_h_shift ()
int get_height ()
csTextureHandleget_parent ()
int get_size ()
 Query image size (alas we can't do (h << shf_w)).
int get_w_mask ()
int get_w_shift ()
int get_width ()
virtual ~csTexture ()
 Destroy the texture object.

Protected Member Functions

void compute_masks ()
 Compute shf_x and and_x values.

Protected Attributes

int and_h
int and_w
 (1 << log2(width)) - 1 and (1 << log2(height)) - 1
int h
csTextureHandleparent
 The parent csTextureHandle object.
int shf_h
int shf_w
 log2(width) and log2(height)
int w
 Width and height.


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 207 of file txtmgr.h.


Constructor & Destructor Documentation

csTexture::csTexture csTextureHandle Parent  ) 
 

Create a csTexture object.

virtual csTexture::~csTexture  )  [virtual]
 

Destroy the texture object.


Member Function Documentation

void csTexture::compute_masks  )  [protected]
 

Compute shf_x and and_x values.

int csTexture::get_size  )  [inline]
 

Query image size (alas we can't do (h << shf_w)).

Definition at line 241 of file txtmgr.h.


Member Data Documentation

int csTexture::and_w [protected]
 

(1 << log2(width)) - 1 and (1 << log2(height)) - 1

Definition at line 217 of file txtmgr.h.

csTextureHandle* csTexture::parent [protected]
 

The parent csTextureHandle object.

Definition at line 211 of file txtmgr.h.

int csTexture::shf_w [protected]
 

log2(width) and log2(height)

Definition at line 215 of file txtmgr.h.

int csTexture::w [protected]
 

Width and height.

Definition at line 213 of file txtmgr.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.4