DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyGraphicsInstanceGroup Class Reference

A class that represents an instance group. An instance group is a collection meshes, attached to shapes, that can be drawn with a single draw call using supplemental instance data information. An instance group can contain segmented meshes or skinned mesh (but not mixed in the same group). More...

#include <diguyGraphicsInstanceGroup.h>

Inheritance diagram for diguyGraphicsInstanceGroup:
diguyOglGraphicsInstanceGroup

Public Member Functions

Accessor Functions

The functions in this section provide access to data in this object.

They are designed to be called by DI-Guy programmers.

Unless otherwise noted all functions in this class section are callable from:

  • C++
  • Script
long get_uid () const
 Instance groups are assigned a unique identifier, or uid. More...
 
int get_num_instances () const
 Returns the number of instances in the instance group. More...
 
int get_start_link_offset () const
 This function returns the name of the shape. More...
 
int get_num_links () const
 Returns the number of links for instances with skinned geometry. More...
 
diguyGraphicsShaderProgramget_shader_program () const
 This function returns a pointer to the shader program designated for this instance group. More...
 
diguyGraphicsMeshget_diguy_mesh ()
 Returns a pointer to the low level geometry mesh object that comprises the renderable for the instances in the group. More...
 
const float * get_instance_data ()
 Returns a pointer to the raw instance data for the instance group. More...
 
int get_instance_data_size ()
 Return the size of the data for the instance group in bytes. More...
 
int get_instance_data_all_groups_size ()
 Return the size of the data for all instance groups in bytes. More...
 
virtual void build ()
 This function will be called by DI-Guy when it is time for a renderer specific instance group to be created. More...
 
virtual void unbuild ()
 This function will be called by DI-Guy when it is time for a instance group to be destroyed. More...
 
virtual void update ()
 This function will be called by DI-Guy when it is time for the instance group to be updated with new data. More...
 
virtual int bind_instance_group_data (int start, int count)
 This function will be called by DI-Guy when variables for using the instance data needs to be sent to the graphics card. More...
 
virtual int bind_instance_buffer_data (int num_floats, const float *instance_data)
 This function will be called by DI-Guy when data for instance groups needs to be sent to the graphics card. More...
 

Private Functions

The functions and variables past this point are for internal use only.

No external access to them is expected or necessary.

bdiInstanceGroupm_scripted_object
 A pointer to internal data. More...
 
class bdiInstanceGroup
 
class bdiGraphicsFactory
 
bdiInstanceGroupget_scripted_object ()
 
 diguyGraphicsInstanceGroup (void *internal_data)
 A protected constructor. More...
 
virtual ~diguyGraphicsInstanceGroup ()
 A protected destructor. More...
 

Detailed Description

A class that represents an instance group. An instance group is a collection meshes, attached to shapes, that can be drawn with a single draw call using supplemental instance data information. An instance group can contain segmented meshes or skinned mesh (but not mixed in the same group).

Can be subclassed by filling out the diguy_graphics_set_instance_group_create_func().

Constructor & Destructor Documentation

diguyGraphicsInstanceGroup::diguyGraphicsInstanceGroup ( void *  internal_data)
protected

A protected constructor.

Constructors are called automatically by DI-Guy.

virtual diguyGraphicsInstanceGroup::~diguyGraphicsInstanceGroup ( )
protectedvirtual

A protected destructor.

Destructors are called automatically by DI-Guy.

Member Function Documentation

long diguyGraphicsInstanceGroup::get_uid ( ) const

Instance groups are assigned a unique identifier, or uid.

This function returns the uid of the instance group.

Note: uid will change between DI Guy runs.

Returns: uid of the instance group

int diguyGraphicsInstanceGroup::get_num_instances ( ) const

Returns the number of instances in the instance group.

Returns:

number of instances

int diguyGraphicsInstanceGroup::get_start_link_offset ( ) const

This function returns the name of the shape.

The returned pointer will never be NULL.

Returns:

name of the shape as C string

int diguyGraphicsInstanceGroup::get_num_links ( ) const

Returns the number of links for instances with skinned geometry.

Note: will return 0 if the geometry is not skinned

Returns:

number of links

diguyGraphicsShaderProgram* diguyGraphicsInstanceGroup::get_shader_program ( ) const

This function returns a pointer to the shader program designated for this instance group.

if any. Shader programs are shared objects usable meshes and instance groups. by many meshes.

Returns:

pointer to diguyGraphicsShaderProgram, or NULL if this instance group does not have a shader specified

diguyGraphicsMesh* diguyGraphicsInstanceGroup::get_diguy_mesh ( )

Returns a pointer to the low level geometry mesh object that comprises the renderable for the instances in the group.

Returns:

pointer of type diguyGraphicsMesh

const float* diguyGraphicsInstanceGroup::get_instance_data ( )

Returns a pointer to the raw instance data for the instance group.

Returns:

pointer to the instance data

int diguyGraphicsInstanceGroup::get_instance_data_size ( )

Return the size of the data for the instance group in bytes.

Returns:

size, in bytes, of the instance buffer data

int diguyGraphicsInstanceGroup::get_instance_data_all_groups_size ( )

Return the size of the data for all instance groups in bytes.

Returns:

size, in bytes of instance buffer data of all groups

virtual void diguyGraphicsInstanceGroup::build ( )
virtual

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

All information to construct the instance group for consumption by either an immediate mode or scene graph renderer is avaiable via the Accessor Functions above when this function is called.

Immediate Mode:

Immediate mode renderers do not usually override this function.

Scene Graph:

Scene graph renderers override this function to create scene graph specific objects to handle mangement and rendering of the instance group.

Callable From:

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

Reimplemented in diguyOglGraphicsInstanceGroup.

virtual void diguyGraphicsInstanceGroup::unbuild ( )
virtual

This function will be called by DI-Guy when it is time for a instance group 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 in diguyOglGraphicsInstanceGroup.

virtual void diguyGraphicsInstanceGroup::update ( )
virtual

This function will be called by DI-Guy when it is time for the instance group to be updated with new data.

Immediate Mode:

Immediate mode renderers usually do not override this function.

Scene Graph:

Scene graph renderers should override this function if they are supporting instancing.

Callable From:

  • N/A (automatically called by DI-Guy Graphics API during Update Stage)
virtual int diguyGraphicsInstanceGroup::bind_instance_group_data ( int  start,
int  count 
)
virtual

This function will be called by DI-Guy when variables for using the instance data needs to be sent to the graphics card.

For GLSL-based shaders, these values are typically passed into the vertex shader via uniform variables.

Immediate Mode:

Immediate mode renderers usually do override this function.

Scene Graph:

Scene graph renderers usually do not override this function, but instead use diguyGraphicsShape::get_shader_matrix_data() during the Update Stage.

Callable From:

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

Reimplemented in diguyOglGraphicsInstanceGroup.

virtual int diguyGraphicsInstanceGroup::bind_instance_buffer_data ( int  num_floats,
const float *  instance_data 
)
virtual

This function will be called by DI-Guy when data for instance groups needs to be sent to the graphics card.

Immediate Mode:

Immediate mode renderers usually do override this function.

Scene Graph:

Scene graph renderers usually do not override this function, but instead update the instance data in diguyGraphicsInstanceGroup::update()

Callable From:

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

Reimplemented in diguyOglGraphicsInstanceGroup.

bdiInstanceGroup* diguyGraphicsInstanceGroup::get_scripted_object ( )
inline

Friends And Related Function Documentation

friend class bdiInstanceGroup
friend
friend class bdiGraphicsFactory
friend

Member Data Documentation

bdiInstanceGroup* diguyGraphicsInstanceGroup::m_scripted_object
private

A pointer to internal data.


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