diguyGraphicsMaterial

Generated from diguyGraphicsMaterial.h

DI-Guy API Version 12.5.1

This file was automatically generated from diguyGraphicsMaterial.h. Do not edit this file directly; the changes will be lost.
Includes: diguy_constants.h | declspec_diguy.h

Contents:

Alphabetical Index

Link against: libdiguy_graphics_api

class diguyGraphicsMaterial

class BDI_DECLSPEC_diguy diguyGraphicsMaterial
{
public:
    const char* get_name();
#ifdef CPLUSPLUS_ONLY
    void get_ambient(float* rgba);
    void get_diffuse(float* rgba);
    void get_specular(float* rgba);
    void get_emission(float* rgba);
    void get_shininess(float* s);
    int get_contains_alpha_component();
    void free_loader_memory();
    static diguyGraphicsMaterial* get_last_bound_material();
    static void clear_last_bound_material();
#endif
#ifdef CPLUSPLUS_ONLY
    virtual void build();
    virtual void unbuild();
    virtual void bind_now();
#endif
Accessor Functions
The functions in this section provide access to data in this object. They are designed to be called by DI-Guy programmers.

function diguyGraphicsMaterial::get_name

Prototype:

const char* get_name();
Description:

Returns the name of the texture. This pointer will never be NULL.

Returns:

name of the texture

Callable From:

function diguyGraphicsMaterial::get_ambient

Prototype:

void get_ambient(float* rgba);
Description:

This function returns the red, green, blue, and alpha components of the material's ambient setting. All returned values will be between 0 (least intensity) and 1 (highest intensity).

Arguments:

rgbapointer to an array of four floats into which results should be copied
Callable From:

function diguyGraphicsMaterial::get_diffuse

Prototype:

void get_diffuse(float* rgba);
Description:

This function returns the red, green, blue, and alpha components of the material's diffuse setting. All returned values will be between 0 (least intensity) and 1 (highest intensity).

Arguments:

rgbapointer to an array of four floats into which results should be copied
Callable From:

function diguyGraphicsMaterial::get_specular

Prototype:

void get_specular(float* rgba);
Description:

This function returns the red, green, blue, and alpha components of the material's specular setting. All returned values will be between 0 (least intensity) and 1 (highest intensity).

Arguments:

rgbapointer to an array of four floats into which results should be copied
Callable From:

function diguyGraphicsMaterial::get_emission

Prototype:

void get_emission(float* rgba);
Description:

This function returns the red, green, blue, and alpha components of the material's emission setting. All returned values will be between 0 (least intensity) and 1 (highest intensity).

Arguments:

rgbapointer to an array of four floats into which results should be copied
Callable From:

function diguyGraphicsMaterial::get_shininess

Prototype:

void get_shininess(float* s);
Description:

This function returns the material's shininess setting.

Arguments:

spointer to float into which result should be copied
Callable From:

function diguyGraphicsMaterial::get_contains_alpha_component

Prototype:

int get_contains_alpha_component();
Description:

This function returns whether the material contains an alpha component. Materials that have an alpha component can make objects semi-transparent, which can affect when said objects should be drawn.

Returns:

1 if texture contains an alpha component, 0 if not; -1 on failure

Callable From:

function diguyGraphicsMaterial::free_loader_memory

Prototype:

void free_loader_memory();
Description:

This function frees most memory allocated by the DI-Guy geometry loader for this object.

This function should only be called during or after the object's build() function has been called. After it has been called, calls to many accessor functions will fail.

Callable From:

function diguyGraphicsMaterial::get_last_bound_material

Prototype:

static diguyGraphicsMaterial* get_last_bound_material();
Description:

This function returns the last material that was bound.

In bind_now() the current material can be checked against the last bound material; if the values are the same the bind_now() function can most often immediately return. This is desirable because rendering state changes can have significant performance overhead.

Callable From:

function diguyGraphicsMaterial::clear_last_bound_material

Prototype:

static void clear_last_bound_material();
Description:

This function clears out the last bound material pointer.

diguyScenario::draw() calls it automatically, but it's recommended that this function also be called when the drawing of a new character is beginning. This can be done in diguyGraphicsLink::begin_character_draw().

Callable From:

Virtual Functions
The functions in this section are all virtual functions that will be called by DI-Guy at various times during DI-Guy execution.

Because the functions are all virtual, DI-Guy programmers can create a subclass of this class and override them. Unless otherwise stated, the base class functions do not need to be called.

function diguyGraphicsMaterial::build

Prototype:

virtual void build();
Description:

This function will be called by DI-Guy when it is time for a renderer-specific material object to be created. At that point all material information has been read 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() to set material attributes.

Scene Graph:

Scene graph renderers usually do override this function, to create a material object that will be associated with diguyGraphicsMesh objects.

Callable From:

function diguyGraphicsMaterial::unbuild

Prototype:

virtual void unbuild();
Description:

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

function diguyGraphicsMaterial::bind_now

Prototype:

virtual void bind_now();
Description:

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

Note that this material should be checked against the material returned by get_last_bound_material(). If they're the same this function should return early.

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 material state.

Scene Graph:

Scene graph renderers usually do not override this function.

Callable From:


Alphabetical Index




Copyright (C) 1992-2012 Boston Dynamics

ALL RIGHTS RESERVED.

These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.

Contractor/Manufacturer is:

Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.