#include <AlEnvironment.h>
class AlEnvironment : public AlObject,
virtual ~AlEnvironment();
virtual AlAnimatable* asAnimatablePtr();
virtual AlObjectType type() const;
virtual AlEnvironment* asEnvironmentPtr();
virtual const char* name() const;
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
AlTexture* firstTexture() const;
AlTexture* nextTexture( AlTexture* ) const;
statusCode nextTextureD( AlTexture* ) const;
statusCode parameter( const AlShadingFields, double* ) const;
statusCode parameter( const AlShadingFields, double& ) const;
statusCode setParameter( const AlShadingFields, const double );
AlList* fields() const;
AlList* mappedFields() const;
statusCode addTexture( const char*, const char*, AlTexture** = NULL );
statusCode removeTexture( const char* );
statusCode applyIteratorToTextures( AlIterator *, int& );
An environment object may reference textures. The firstTexture and nextTexture methods are used to access these textures.
firstTexture() returns the first texture that the environment object references. nextTexture() moves from a given referenced texture to the next texture in order, as related to the environment object. (See the similar methods for the AlTexture/AlShader classes.)
The animation on the environment can be accessed through the firstChannel() and nextChannel() methods. All the channels on the environment can be deleted by calling deleteAnimation().
Summary
AlEnvironment::~AlEnvironment()
Description
This method deletes the AlEnvironment wrapper object. It is not possible to delete an environment. statusCode AlEnvironment::deleteObject()
Description
It is not possible to delete the environment shader. This method always returns sFailure. Return codes
sFailure - always returned AlObject *AlEnvironment::copyWrapper() const
Description
This method creates an exact copy of the AlEnvironment wrapper. AlObjectType AlEnvironment::type() const
Description
Returns the class identifier 'kEnvironmentType'. AlEnvironment* AlEnvironment::asEnvironmentPtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class. const char* AlEnvironment::name() const
Description
Returns the name of the environment shader (it is constant for now). statusCode AlEnvironment::parameter( const AlShadingFields field, double& result ) const
Description
This method finds the value of a given environment field. Arguments
< field - environment field type Return codes
sSuccess - the value of the field was returned statusCode AlEnvironment::setParameter( const AlShadingFields field,const double "value" )
Description
Changes the value of the environment field. Arguments
< field - environment field type Return codes
sSuccess - the value of the field was changed AlTexture* AlEnvironment::firstTexture() const
Description
Returns the first texture that this environment object references. If there are none then NULL is returned. AlTexture* AlEnvironment::nextTexture( AlTexture* last_texture ) const
Description
Returns the texture after the given one in the environment's texture list. Specifying NULL as parameter will return the first texture. Arguments
< last_texture - the texture from which to walk forward statusCode AlEnvironment::nextTextureD( AlTexture* last_texture ) const
Description
Destructively points 'last_texture' to the texture after the given one in the shader's texture list. Arguments
<> last_texture - the texture from which to walk forward Return codes
sSuccess - 'last_texture' now points to the next texture AlList* AlEnvironment::fields() const
Description
This method returns an AlList of AlShadingFieldItems, each of which contains an AlShadingFields value valid for this environment. Note that this list is allocated and must be freed using 'delete AlList*'. AlList* AlEnvironment::mappedFields() const
Description
This method returns an AlList of AlMappedFieldItems, each of which contains a character string identifier identifying a field on this environment which may be texture mapped. Note that these strings are identical to the SDL identifiers and the complete list can be found in the SDL manual. statusCode AlEnvironment::removeTexture( const char* fieldName )
Description
This method removes a texture from a particular field of the AlEnvironment. The first argument is the name of the field which will have the texture applied to it. Only those fields valid for this shader should be provided; any others will cause this method to fail. Valid fields are any returned by the fields() method. Arguments
< fieldName - name of the field which will have the texture removed from it Return codes
sSuccess - the texture was added successfully. statusCode AlEnvironment::addTexture( const char* fieldName, const char* textureName, AlTexture** returnCreatedTexture )
Description
This method adds a texture to a particular field of the AlEnvironment. The first argument is the name of the field that will have the texture applied to it. Only those fields valid for this environment should be provided; any others will cause this method to fail. Valid fields are any returned by the fields() method. The second argument is the name of the texture type to apply to the field. The complete list of names is available in the SDL manual. Arguments
< fieldName - name of the field which will have the texture applied to it Return codes
sSuccess - the texture was added successfully. statusCode AlEnvironment::applyIteratorToTextures( AlIterator *iter, int &rc )
Description
Apply the given AlIterator to all textures of this environment. The second argument will be set to the return value of the last application of the iterator's function. See the AlIterator class for more information.
Arguments
< iter - the iterator to apply to each texture Return codes
sSuccess - the application of the iterator terminated normally