OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreGpuProgramManager.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2011 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __GpuProgramManager_H_
29 #define __GpuProgramManager_H_
30 
31 // Precompiler options
32 #include "OgrePrerequisites.h"
33 #include "OgreResourceManager.h"
34 #include "OgreException.h"
35 #include "OgreGpuProgram.h"
36 #include "OgreSingleton.h"
37 
38 namespace Ogre {
39 
46  class _OgreExport GpuProgramManager : public ResourceManager, public Singleton<GpuProgramManager>
47  {
48  public:
49 
52 
53 
54  protected:
55 
57 
59  virtual Resource* createImpl(const String& name, ResourceHandle handle,
60  const String& group, bool isManual, ManualResourceLoader* loader,
61  GpuProgramType gptype, const String& syntaxCode) = 0;
62  public:
64  virtual ~GpuProgramManager();
65 
77  virtual GpuProgramPtr load(const String& name, const String& groupName,
78  const String& filename, GpuProgramType gptype,
79  const String& syntaxCode);
80 
92  virtual GpuProgramPtr loadFromString(const String& name, const String& groupName,
93  const String& code, GpuProgramType gptype,
94  const String& syntaxCode);
95 
97  virtual const SyntaxCodes& getSupportedSyntax(void) const;
98 
99 
101  virtual bool isSyntaxSupported(const String& syntaxCode) const;
102 
108  virtual GpuProgramParametersSharedPtr createParameters(void);
109 
124  virtual GpuProgramPtr createProgram(const String& name,
125  const String& groupName, const String& filename,
126  GpuProgramType gptype, const String& syntaxCode);
127 
142  virtual GpuProgramPtr createProgramFromString(const String& name,
143  const String& groupName, const String& code,
144  GpuProgramType gptype, const String& syntaxCode);
145 
149  virtual ResourcePtr create(const String& name, const String& group,
150  GpuProgramType gptype, const String& syntaxCode, bool isManual = false,
151  ManualResourceLoader* loader = 0);
152 
158  ResourcePtr getByName(const String& name, bool preferHighLevelPrograms = true);
159 
160 
166  virtual GpuSharedParametersPtr createSharedParameters(const String& name);
167 
171  virtual GpuSharedParametersPtr getSharedParameters(const String& name) const;
172 
175  virtual const SharedParametersMap& getAvailableSharedParameters() const;
176 
192  static GpuProgramManager& getSingleton(void);
208  static GpuProgramManager* getSingletonPtr(void);
209 
210 
211 
212  };
213 
216 }
217 
218 #endif
#define _OgreExport
Definition: OgrePlatform.h:203
Specialisation of SharedPtr to allow SharedPtr to be assigned to GpuProgramPtr.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
GpuProgramType
Enumerates the types of programs which can run on the GPU.
Interface describing a manual resource loader.
Definition: OgreResource.h:512
map< String, GpuSharedParametersPtr >::type SharedParametersMap
SharedParametersMap mSharedParametersMap
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:77
unsigned long long int ResourceHandle
Definition: OgreResource.h:39
set< String >::type SyntaxCodes
Defines a generic resource handler.
_StringBase String