DI-Guy SDK Documentation  13.5
diguyOsgGraphicsTexture Class Reference

#include <diguyOsgGraphicsTexture.h>

Inheritance diagram for diguyOsgGraphicsTexture:
diguyGraphicsTexture

Public Member Functions

 diguyOsgGraphicsTexture (void *internal_data)
 
virtual ~diguyOsgGraphicsTexture ()
 
virtual void asynchronous_post_load ()
 This function will be called by DI-Guy after the texture is loaded but before build. More...
 
virtual void build ()
 This function will be called by DI-Guy when it is time for a renderer-specific texture object to be created. More...
 
virtual void unbuild ()
 This function will be called by DI-Guy when it is time for a renderer-specific texture object to be destroyed. More...
 
virtual void bind_now (diguyTextureMapType texture_type)
 This function will be called by DI-Guy when the texture should be made active, or bound. More...
 
osg::Texture2D * get_texture ()
 
void releaseGLObjects ()
 
- Public Member Functions inherited from diguyGraphicsTexture
const char * get_name ()
 Returns the name of the texture. More...
 
const char * get_filename ()
 This function returns the filename of the texture. More...
 
const char * get_full_filename ()
 Returns: Where diguy found the file name... will be null if source data isn't available. More...
 
const char * get_cached_dds_filename ()
 Returns: The file after transformation and stored in compressed_texture_cache. More...
 
int get_width ()
 Returns: the width of the texture, in pixels; -1 on failure. More...
 
int get_height ()
 Returns: the height of the texture, in pixels; -1 on failure. More...
 
int get_num_components ()
 This function returns how many components the texture has. More...
 
int get_contains_alpha_component ()
 This function returns whether the texture contains an alpha component. More...
 
int get_is_clip_map ()
 Returns if this texture should be rendered with alpha to coverage, Clip maps have 4 channels but return false for get_contains_alpha_component Useful for screen door transparency, and out of order transparency. More...
 
unsigned char * get_texture_map_data ()
 This function returns a memory buffer with the actual texture data. More...
 
int get_texture_map_data_size ()
 This function returns how many bytes are used by the texture map data buffer. More...
 
diguyGraphicsTextureCompressionType get_texture_compression_type ()
 This function returns which compression method, if any, is applied to the data returned bu get_texture_map_data(). More...
 
int get_num_included_mipmaps ()
 This function returns how many mipmaps are already included in the texture map data. More...
 
int get_mipmap_data_size (int mipmap)
 This function returns the size of the data, in bytes, of the specified mipmap. More...
 
int get_mipmap_data_offset (int mipmap)
 This function returns the data offset of the specified mipmap into the data pointer returned by get_texture_map_data(). More...
 
int get_gl_format ()
 This function returns the OpenGL pixel format enumeration of this texture. More...
 
const char * get_gl_format_as_string ()
 This function returns the OpenGL pixel format string of this texture. More...
 
int get_is_srgb_texture ()
 returns if texture should use sRGB style format hints, useful in DX11 where gl_format is less useful. More...
 
int get_dds_block_size ()
 This function returns the "block size" of the dds compression types. More...
 
int get_clamp_s ()
 For texture indices less than zero and greater than one, a decision must be made as to whether the texture is repeated or whether the edge pixels are replicated to fill the space. More...
 
int get_clamp_t ()
 For texture indices less than zero and greater than one, a decision must be made as to whether the texture is repeated or whether the edge pixels are replicated to fill the space. More...
 
int get_is_in_async_load_queue ()
 Is this texture currently being loaded by the asynchronous texture loader. More...
 
void get_approximate_color (float **\return, float *g, float **< b >)
 Returns an approximation of the overall color based on mip-mapping that was generated when bdg files were built. More...
 
</b > void free_loader_memory ()
 This function frees most memory allocated by the DI-Guy geometry loader for this object. More...
 
void load_texture_data (int async_load)
 
bdiGeometryTextureFileget_scripted_object ()
 

Static Public Attributes

static osg::ref_ptr< osg::State > sm_state
 

Protected Attributes

osg::ref_ptr< osg::Texture2D > m_texture
 
osg::ref_ptr< osg::Image > m_image
 

Additional Inherited Members

- Static Public Member Functions inherited from diguyGraphicsTexture
static diguyGraphicsTextureget_last_bound_texture (int texture_unit=0)
 This function returns the last bound texture used by DI-Guy. More...
 
static void clear_last_bound_texture ()
 This function clears out the last bound texture variable. More...
 
- Protected Member Functions inherited from diguyGraphicsTexture
 diguyGraphicsTexture (void *internal_data)
 A protected constructor. More...
 
virtual ~diguyGraphicsTexture ()
 A protected destructor. More...
 

Constructor & Destructor Documentation

diguyOsgGraphicsTexture::diguyOsgGraphicsTexture ( void *  internal_data)
diguyOsgGraphicsTexture::~diguyOsgGraphicsTexture ( )
virtual

Member Function Documentation

void diguyOsgGraphicsTexture::asynchronous_post_load ( )
virtual

This function will be called by DI-Guy after the texture is loaded but before build.

When asynchronous texture loading is active this provides an opportunity to copy data from DI-Guy structures to end user structures in the background loading thread.

Immediate Mode:

Immediate mode renderers may override this function.

Scene Graph:

Scene graph renderers may override this function, if they are using the async texture loader. may need to be coupled with calls to diguyScenario::run_background_load_update()

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during the Build Stage)

Reimplemented from diguyGraphicsTexture.

void diguyOsgGraphicsTexture::build ( )
virtual

This function will be called by DI-Guy when it is time for a renderer-specific texture object to be created.

At that point the texture information has been read from the texture file, and is available via the Accessor Functions above.

Immediate Mode:

Immediate mode renderers may override this function, to create an object that may be invoked by bind_now().

Scene Graph:

Scene graph renderers usually do override this function, to create an object that gets associated with diguyGraphicsMesh objects.

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during the Build Stage)

Reimplemented from diguyGraphicsTexture.

void diguyOsgGraphicsTexture::unbuild ( )
virtual

This function will be called by DI-Guy when it is time for a renderer-specific texture object to be destroyed.

Immediate Mode:

Immediate mode renderers may override this function, to destroy any object that may have been created by build().

Scene Graph:

Scene graph renderers usually do override this function, to destroy any object that may have been created by build().

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during the Unbuild Stage)

Reimplemented from diguyGraphicsTexture.

void diguyOsgGraphicsTexture::bind_now ( diguyTextureMapType  texture_type)
virtual

This function will be called by DI-Guy when the texture should be made active, or bound.

Immediate Mode:

Immediate mode renderers usually do override this function, to invoke the object created by build(), or make calls to the renderer to set appropriate texture state.

Scene Graph:

Scene graph renderers usually do not override this function.

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during Draw Stage)

Reimplemented from diguyGraphicsTexture.

osg::Texture2D* diguyOsgGraphicsTexture::get_texture ( )
inline
void diguyOsgGraphicsTexture::releaseGLObjects ( )

Member Data Documentation

osg::ref_ptr< osg::State > diguyOsgGraphicsTexture::sm_state
static
osg::ref_ptr<osg::Texture2D> diguyOsgGraphicsTexture::m_texture
protected
osg::ref_ptr<osg::Image> diguyOsgGraphicsTexture::m_image
protected

The documentation for this class was generated from the following files: