DI-Guy SDK Documentation  13.5
diguyOsgGraphicsState Class Reference

Graphics state objects mostly serve as containers for other sub-objects, such as materials and textures, that control the visual state of geometry. More...

#include <diguyOsgGraphicsState.h>

Inheritance diagram for diguyOsgGraphicsState:
diguyGraphicsState

Public Member Functions

 diguyOsgGraphicsState (void *internal_data)
 
virtual void build ()
 This function will be called by DI-Guy when it is time for a renderer-specific state object to be created. More...
 
virtual void unbuild ()
 This function will be called by DI-Guy when it is time for a renderer-specific state object to be destroyed. More...
 
osg::StateSet * get_state_set ()
 
- Public Member Functions inherited from diguyGraphicsState
diguyGraphicsMaterialget_material ()
 This function returns the material of this state. More...
 
int get_num_textures ()
 This function returns the number of textures this state has. More...
 
diguyGraphicsTextureget_texture (int texture_index=0)
 This function returns the nth texture of this state. More...
 
diguyTextureMapType get_texture_type (int index) const
 This function returns the way that a texture is used in the state. More...
 
int get_textures_available () const
 This function returns a bit-wise or'ed mask of available textures in this state. More...
 
diguyGraphicsTextureArrayget_texture_array ()
 return Decal array More...
 
int get_contains_alpha_component () const
 This function returns whether either the material or texture of this state contains an alpha component. More...
 
int get_is_unlit () const
 This function returns whether faces drawn with this state should be lit or unlit. More...
 
void free_loader_memory ()
 This function frees most memory allocated by the DI-Guy geometry loader for this object. More...
 
virtual void bind_now ()
 This function will be called by DI-Guy when the state should be made active, or bound. More...
 
void bind (int texture_mask)
 Calls bind on internal class which will bind materials and appropriate textures. More...
 
bdiGeometryGeosetStateget_scripted_object ()
 

Protected Attributes

osg::ref_ptr< osg::StateSet > m_state_set
 

Additional Inherited Members

- Protected Member Functions inherited from diguyGraphicsState
 diguyGraphicsState (void *internal_data)
 A protected constructor. More...
 
virtual ~diguyGraphicsState ()
 A protected destructor. More...
 

Detailed Description

Graphics state objects mostly serve as containers for other sub-objects, such as materials and textures, that control the visual state of geometry.

At times renderer-specific objects need to be created in this level, as well.

The class diguyOsgGraphicsState is an example of a diguyGraphicsState subclass for a scene graph renderer using the DI-Guy Loader. The example subclass shows how to use the accessors of the diguyGraphicsState class and which virtual functions should be overridden for a scene graph renderer such as OSG.

Constructor & Destructor Documentation

diguyOsgGraphicsState::diguyOsgGraphicsState ( void *  internal_data)

Member Function Documentation

void diguyOsgGraphicsState::build ( )
virtual

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

A subclass of this class isn't always necessary, particularly for immediate mode renderers in which everything might be done in a subclass of diguyGraphicsMaterial and a subclass of diguyGraphicsTexture.

Immediate Mode:

Immediate mode renderers usually do not override this function.

Scene Graph:

Scene graph renderers may override this function, to create a state object that will be associated with diguyGraphicsMesh objects.

The subclass version of this function may need to refer to material and texture objects created by the build() calls of subclasses of diguyGraphicsMaterial and diguyGraphicsTexture objects.

Callable From:

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

Reimplemented from diguyGraphicsState.

void diguyOsgGraphicsState::unbuild ( )
virtual

This function will be called by DI-Guy when it is time for a renderer-specific state 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 may 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 diguyGraphicsState.

osg::StateSet* diguyOsgGraphicsState::get_state_set ( )
inline

Member Data Documentation

osg::ref_ptr<osg::StateSet> diguyOsgGraphicsState::m_state_set
protected

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