hoa_video::private_video::TexSheet Class Reference

An actual OpenGL texture which can be used for storing multiple smaller images in it. More...

#include <tex_mgmt.h>

Collaboration diagram for hoa_video::private_video::TexSheet:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool AddImage (Image *img, ImageLoadInfo &load_info)
 Adds new image to the tex sheet.
bool CopyRect (int32 x, int32 y, private_video::ImageLoadInfo &load_info)
 Copies an image into a sub-rectangle of the texture.
bool CopyScreenRect (int32 x, int32 y, const ScreenRect &screen_rect)
 Copies an portion of the screen into a sub-rectangle of the texture.
bool FreeImage (Image *img)
 Marks the image as free.
bool Reload ()
 Reloads all the images into the sheet.
bool RemoveImage (Image *img)
 Removes an image completely.
bool RestoreImage (Image *img)
 Marks a previously freed image as "used".
 TexSheet (int32 w, int32 h, GLuint texID_, TexSheetType type_, bool is_static_)
bool Unload ()
 Unloads texture memory used by this sheet.
 ~TexSheet ()

Public Attributes

int32 height
 Height of the texsheet.
bool is_static
 If true, images in this sheet that are unlikely to change.
bool loaded
 Flag indicating if texsheet is loaded.
GLuint tex_ID
 Number OpenGL uses to refer to this texture.
TexMemMgrtex_mem_manager
 Manages which areas of the texture are free.
TexSheetType type
 Does it hold 32x32, 32x64, 64x64, or any kind.
int32 width
 Width of the texsheet.

Detailed Description

An actual OpenGL texture which can be used for storing multiple smaller images in it.

The purpose of this is to save on texture switches, so an increased performance can be achieved.

Note:
This is called TexSheet instead of Texture, so it's clear that this doesn't represent an image that you would draw on the screen, but simply a "container" for smaller images.

Definition at line 131 of file tex_mgmt.h.


Constructor & Destructor Documentation

hoa_video::private_video::TexSheet::TexSheet ( int32  w,
int32  h,
GLuint  texID_,
TexSheetType  type_,
bool  is_static_ 
)

hoa_video::private_video::TexSheet::~TexSheet (  ) 


Member Function Documentation

bool hoa_video::private_video::TexSheet::AddImage ( Image img,
ImageLoadInfo load_info 
)

Adds new image to the tex sheet.

Parameters:
img The image to add
load_info The image loading info
Returns:
Success/failure

Referenced by hoa_video::GameVideo::_InsertImageInTexSheet().

bool hoa_video::private_video::TexSheet::CopyRect ( int32  x,
int32  y,
private_video::ImageLoadInfo load_info 
)

Copies an image into a sub-rectangle of the texture.

Parameters:
x X coordinate of rectangle to copy image to
y Y coordinate of rectangle to copy image to
load_info The image loading info
Returns:
Success/failure

Referenced by hoa_video::GameVideo::_ReloadImagesToSheet().

bool hoa_video::private_video::TexSheet::CopyScreenRect ( int32  x,
int32  y,
const ScreenRect screen_rect 
)

Copies an portion of the screen into a sub-rectangle of the texture.

Parameters:
x X coordinate of rectangle to copy screen to
y Y coordinate of rectangle to copy screen to
screen_rect The portion of the screen
Returns:
Success/failure

Referenced by hoa_video::GameVideo::CaptureScreen().

bool hoa_video::private_video::TexSheet::FreeImage ( Image img  ) 

Marks the image as free.

Parameters:
img The image to mark as free
Returns:
Success/failure

Referenced by hoa_video::GameVideo::_DeleteImage().

bool hoa_video::private_video::TexSheet::Reload (  ) 

Reloads all the images into the sheet.

Returns:
Success/failure

Referenced by hoa_video::GameVideo::ReloadTextures().

bool hoa_video::private_video::TexSheet::RemoveImage ( Image img  ) 

Removes an image completely.

Parameters:
img The image to remove
Returns:
Success/failure

bool hoa_video::private_video::TexSheet::RestoreImage ( Image img  ) 

Marks a previously freed image as "used".

Parameters:
img The image to mark as used
Returns:
Success/failure

Referenced by hoa_video::GameVideo::_LoadMultiImage().

bool hoa_video::private_video::TexSheet::Unload (  ) 

Unloads texture memory used by this sheet.

Returns:
Success/failure

Referenced by hoa_video::GameVideo::UnloadTextures().


Member Data Documentation

int32 hoa_video::private_video::TexSheet::height

Height of the texsheet.

Definition at line 197 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::_DEBUG_ShowTexSheet(), hoa_video::GameVideo::_GetBufferFromTexture(), and hoa_video::GameVideo::SaveImage().

bool hoa_video::private_video::TexSheet::is_static

If true, images in this sheet that are unlikely to change.

Definition at line 200 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::_DEBUG_ShowTexSheet().

bool hoa_video::private_video::TexSheet::loaded

Flag indicating if texsheet is loaded.

Definition at line 212 of file tex_mgmt.h.

GLuint hoa_video::private_video::TexSheet::tex_ID

Number OpenGL uses to refer to this texture.

Definition at line 209 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::_DEBUG_ShowTexSheet(), hoa_video::GameVideo::_DrawElement(), hoa_video::GameVideo::_GetBufferFromTexture(), hoa_video::private_video::ParticleSystem::Draw(), and hoa_video::GameVideo::SaveImage().

TexMemMgr* hoa_video::private_video::TexSheet::tex_mem_manager

Manages which areas of the texture are free.

Definition at line 206 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::CaptureScreen().

TexSheetType hoa_video::private_video::TexSheet::type

Does it hold 32x32, 32x64, 64x64, or any kind.

Definition at line 203 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::_DEBUG_ShowTexSheet().

int32 hoa_video::private_video::TexSheet::width

Width of the texsheet.

Definition at line 194 of file tex_mgmt.h.

Referenced by hoa_video::GameVideo::_DEBUG_ShowTexSheet(), hoa_video::GameVideo::_GetBufferFromTexture(), and hoa_video::GameVideo::SaveImage().


The documentation for this class was generated from the following file:
Generated on Fri Jul 6 23:16:53 2007 for Hero of Allacrost by  doxygen 1.5.1