OgreHighLevelGpuProgram.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __HighLevelGpuProgram_H__
#define __HighLevelGpuProgram_H__
#include "OgrePrerequisites.h"
#include "OgreGpuProgram.h"
namespace Ogre {
class _OgreExport HighLevelGpuProgram : public GpuProgram
{
protected:
bool mHighLevelLoaded;
GpuProgramPtr mAssemblerProgram;
mutable bool mConstantDefsBuilt;
virtual void loadHighLevel(void);
virtual void unloadHighLevel(void);
virtual void loadHighLevelImpl(void);
virtual void createLowLevelImpl(void) = 0;
virtual void unloadHighLevelImpl(void) = 0;
virtual void populateParameterNames(GpuProgramParametersSharedPtr params);
virtual void buildConstantDefinitions() const = 0;
void loadImpl();
void unloadImpl();
public:
HighLevelGpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
~HighLevelGpuProgram();
GpuProgramParametersSharedPtr createParameters(void);
GpuProgram* _getBindingDelegate(void) { return mAssemblerProgram.getPointer(); }
const GpuNamedConstants& getConstantDefinitions() const;
const GpuNamedConstants& getNamedConstants() const { return getConstantDefinitions(); }
virtual size_t calculateSize(void) const;
};
}
#endif
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::GpuNamedConstants
Struct collecting together the information for named constants.
Definition: OgreGpuProgramParams.h:355
Ogre::HighLevelGpuProgram
Abstract base class representing a high-level program (a vertex or fragment program).
Definition: OgreHighLevelGpuProgram.h:63
Ogre::ManualResourceLoader
Interface describing a manual resource loader.
Definition: OgreResource.h:514
Ogre::ResourceHandle
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
Ogre::HighLevelGpuProgram::mAssemblerProgram
GpuProgramPtr mAssemblerProgram
The underlying assembler program.
Definition: OgreHighLevelGpuProgram.h:69
Ogre::HighLevelGpuProgram::mHighLevelLoaded
bool mHighLevelLoaded
Whether the high-level program (and it&#39;s parameter defs) is loaded.
Definition: OgreHighLevelGpuProgram.h:67
OgrePrerequisites.h
Ogre::HighLevelGpuProgram::getNamedConstants
const GpuNamedConstants & getNamedConstants() const
Override GpuProgram::getNamedConstants to ensure built.
Definition: OgreHighLevelGpuProgram.h:125
Ogre::HighLevelGpuProgram::mConstantDefsBuilt
bool mConstantDefsBuilt
Have we built the name->index parameter map yet?
Definition: OgreHighLevelGpuProgram.h:71
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::ResourceManager
Defines a generic resource handler.
Definition: OgreResourceManager.h:122
Ogre::HighLevelGpuProgram::_getBindingDelegate
GpuProgram * _getBindingDelegate(void)
Returns the GpuProgram which should be bound to the pipeline.
Definition: OgreHighLevelGpuProgram.h:116
Ogre::GpuProgram
Defines a program which runs on the GPU such as a vertex or fragment program.
Definition: OgreGpuProgram.h:69
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::SharedPtr< GpuProgram >
Ogre::SharedPtr::getPointer
T * getPointer() const
Definition: OgreSharedPtr.h:273
OgreGpuProgram.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.