CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | 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.
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

csTextureHandleparent
 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

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

References w.


Member Data Documentation

int csTexture::and_h [protected]
 

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

Definition at line 222 of file txtmgr.h.

int csTexture::and_w [protected]
 

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

Definition at line 222 of file txtmgr.h.

int csTexture::h [protected]
 

Width and height.

Definition at line 218 of file txtmgr.h.

csTextureHandle* csTexture::parent [protected]
 

The parent csTextureHandle object.

Definition at line 216 of file txtmgr.h.

int csTexture::shf_h [protected]
 

log2(width) and log2(height)

Definition at line 220 of file txtmgr.h.

int csTexture::shf_w [protected]
 

log2(width) and log2(height)

Definition at line 220 of file txtmgr.h.

int csTexture::w [protected]
 

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:
Generated for Crystal Space by doxygen 1.3.9.1