OgreGpuProgramUsage.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 __GpuProgramUsage_H__
#define __GpuProgramUsage_H__
#include "OgrePrerequisites.h"
#include "OgreGpuProgram.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
class Pass;
class _OgreExport GpuProgramUsage : public Resource::Listener, public PassAlloc
{
protected:
GpuProgramType mType;
Pass* mParent;
GpuProgramPtr mProgram;
GpuProgramParametersSharedPtr mParameters;
bool mRecreateParams;
void recreateParameters();
public:
GpuProgramUsage(GpuProgramType gptype, Pass* parent);
GpuProgramUsage(const GpuProgramUsage& rhs, Pass* newparent);
~GpuProgramUsage();
GpuProgramType getType(void) const { return mType; }
void setProgramName(const String& name, bool resetParams = true);
void setProgram(GpuProgramPtr& prog);
const GpuProgramPtr& getProgram() const { return mProgram; }
const String& getProgramName(void) const { return mProgram->getName(); }
void setParameters(GpuProgramParametersSharedPtr params);
GpuProgramParametersSharedPtr getParameters(void);
void _load(void);
void _unload(void);
size_t calculateSize(void) const;
// Resource Listener
void unloadingComplete(Resource* prog);
void loadingComplete(Resource* prog);
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::Pass
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::GpuProgramUsage::mParent
Pass * mParent
Definition: OgreGpuProgramUsage.h:77
Ogre::GpuProgramUsage::mRecreateParams
bool mRecreateParams
Whether to recreate parameters next load.
Definition: OgreGpuProgramUsage.h:85
Ogre::Resource
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:79
Ogre::GpuProgramUsage::mType
GpuProgramType mType
Definition: OgreGpuProgramUsage.h:76
Ogre::Resource::getName
virtual const String & getName(void) const
Gets resource name.
Definition: OgreResource.h:312
Ogre::GpuProgramUsage::mProgram
GpuProgramPtr mProgram
The program link.
Definition: OgreGpuProgramUsage.h:79
Ogre::Resource::Listener
Definition: OgreResource.h:83
Ogre::GpuProgramUsage::getType
GpuProgramType getType(void) const
Gets the type of program we&#39;re trying to link to.
Definition: OgreGpuProgramUsage.h:101
OgrePrerequisites.h
Ogre::GpuProgramUsage::mParameters
GpuProgramParametersSharedPtr mParameters
Program parameters.
Definition: OgreGpuProgramUsage.h:82
Ogre::GpuProgramUsage::getProgram
const GpuProgramPtr & getProgram() const
Gets the program being used.
Definition: OgreGpuProgramUsage.h:122
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::GpuProgramType
GpuProgramType
Enumerates the types of programs which can run on the GPU.
Definition: OgreGpuProgram.h:50
OgreHeaderSuffix.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::SharedPtr< GpuProgram >
OgreHeaderPrefix.h
Ogre::GpuProgramUsage
This class makes the usage of a vertex and fragment programs (low-level or high-level), with a given set of parameters, explicit.
Definition: OgreGpuProgramUsage.h:73
OgreGpuProgram.h
Ogre::GpuProgramUsage::getProgramName
const String & getProgramName(void) const
Gets the program being used.
Definition: OgreGpuProgramUsage.h:124
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58

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