28 #ifndef __UnifiedHighLevelGpuProgram_H__
29 #define __UnifiedHighLevelGpuProgram_H__
142 void load(
bool backgroundThread =
false);
Defines a program which runs on the GPU such as a vertex or fragment program.
Interface definition for factories of HighLevelGpuProgram.
Abstract base class representing a high-level program (a vertex or fragment program).
Interface describing a manual resource loader.
Abstract class which is command object which gets/sets parameters.
Defines a generic resource handler.
LoadingState
Enum identifying the loading state of the resource.
Factory class for Unified programs.
HighLevelGpuProgram * create(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader)
~UnifiedHighLevelGpuProgramFactory()
const String & getLanguage(void) const
Get the name of the language this factory creates programs for.
UnifiedHighLevelGpuProgramFactory()
void destroy(HighLevelGpuProgram *prog)
Command object for setting delegate (can set more than once)
String doGet(const void *target) const
void doSet(void *target, const String &val)
Specialisation of HighLevelGpuProgram which just delegates its implementation to one other high level...
void reload(void)
Reloads the resource, if it is already loaded.
GpuProgramParametersSharedPtr getDefaultParameters(void)
Get a reference to the default parameters which are to be used for all uses of this program.
bool hasCompileError(void) const
Did this program encounter a compile error when loading?
GpuProgram * _getBindingDelegate(void)
Returns the GpuProgram which should be bound to the pipeline.
StringVector mDelegateNames
Ordered list of potential delegates.
void load(bool backgroundThread=false)
Loads the resource, if it is not already.
bool isBackgroundLoaded(void) const
Returns whether this Resource has been earmarked for background loading.
bool isPoseAnimationIncluded(void) const
Returns whether a vertex program includes the required instructions to perform pose animation.
void unloadHighLevelImpl(void)
Internal unload implementation, must be implemented by subclasses.
void clearDelegatePrograms()
Remove all delegate programs.
void touch(void)
'Touches' the resource to indicate it has been used.
void addDelegateProgram(const String &name)
Adds a new delegate program to the list.
static CmdDelegate msCmdDelegate
HighLevelGpuProgramPtr mChosenDelegate
The chosen delegate.
virtual size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
~UnifiedHighLevelGpuProgram()
void escalateLoading()
Escalates the loading of a background loaded resource.
bool hasDefaultParameters(void) const
Returns true if default parameters have been set up.
bool getPassTransformStates(void) const
Returns whether a vertex program wants transform state to be passed through fixed pipeline low level ...
bool isReloadable(void) const
Returns true if the Resource is reloadable, false otherwise.
void createLowLevelImpl(void)
Internal method for creating an appropriate low-level program from this high-level program,...
bool isLoading() const
Returns whether the resource is currently in the process of background loading.
void unload(void)
Unloads the resource; this is not permanent, the resource can be reloaded later if required.
LoadingState getLoadingState() const
Returns the current loading state.
void buildConstantDefinitions() const
Build the constant definition map, must be overridden.
bool isVertexTextureFetchRequired(void) const
Returns whether this vertex program requires support for vertex texture fetch from the hardware.
UnifiedHighLevelGpuProgram(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
Constructor, should be used only by factory classes.
bool isMorphAnimationIncluded(void) const
Returns whether a vertex program includes the required instructions to perform morph animation.
bool getPassFogStates(void) const
Returns whether a fragment program wants fog state to be passed through fixed pipeline low level API ...
bool isLoaded(void) const
Returns true if the Resource has been loaded, false otherwise.
size_t getSize(void) const
Retrieves info about the size of the resource.
bool isSkeletalAnimationIncluded(void) const
Returns whether a vertex program includes the required instructions to perform skeletal animation.
void setBackgroundLoaded(bool bl)
Tells the resource whether it is background loaded or not.
void loadFromSource(void)
Virtual method which must be implemented by subclasses, load from mSource.
const String & getLanguage(void) const
Returns a string that specifies the language of the gpu programs as specified in a material script.
bool isSupported(void) const
Returns whether this program can be supported on the current renderer and hardware.
void removeListener(Listener *lis)
Remove a listener on this resource.
GpuProgramParametersSharedPtr createParameters(void)
Creates a new parameters object compatible with this program definition.
void addListener(Listener *lis)
Register a listener on this resource.
void resetCompileError(void)
Reset a compile error if it occurred, allowing the load to be retried.
bool getPassSurfaceAndLightStates(void) const
Returns whether a vertex program wants light and material states to be passed through fixed pipeline ...
const HighLevelGpuProgramPtr & _getDelegate() const
Get the chosen delegate.
void chooseDelegate() const
Choose the delegate to use.
vector< String >::type StringVector
unsigned long long int ResourceHandle