OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLSLESCgProgram.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-2014 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 __GLSLESCgProgram_H__
29 #define __GLSLESCgProgram_H__
30 
31 #include "OgreGLSLESProgram.h"
32 #include "OgreStringVector.h"
33 
34 namespace Ogre {
40  {
41  public:
43  class CmdProfiles : public ParamCommand
44  {
45  public:
46  String doGet(const void* target) const;
47  void doSet(void* target, const String& val);
48  };
50  class CmdEntryPoint : public ParamCommand
51  {
52  public:
53  String doGet(const void* target) const;
54  void doSet(void* target, const String& val);
55  };
56 
58  const String& name, ResourceHandle handle,
59  const String& group, bool isManual, ManualResourceLoader* loader);
60  ~GLSLESCgProgram();
61 
62 
64  void loadFromSource(void);
65 
67  const String& getLanguage(void) const;
68 
70  void setEntryPoint(const String& entryPoint) { mEntryPoint = entryPoint; }
72  const String& getEntryPoint(void) const { return mEntryPoint; }
74  void setProfiles(const StringVector& profiles);
76  const StringVector& getProfiles(void) const { return mProfiles; }
77  protected:
82 
83  // check if syntax is supported
84  bool isSyntaxSupported();
86  String resolveCgIncludes(const String& inSource, Resource* resourceBeingLoaded, const String& fileName);
87  // deletes the key word ": register(xx)" that hlsl2glsl doesn't know to handle
88  String deleteRegisterFromCg(const String& inSource);
89  };
90 }
91 
92 #endif // __GLSLESCgProgram_H__
const StringVector & getProfiles(void) const
Gets the Cg profiles which can be supported by the program.
const String & getEntryPoint(void) const
Gets the entry point defined for this program.
#define _OgreGLES2Export
Interface describing a manual resource loader.
Definition: OgreResource.h:514
static CmdProfiles msCmdProfiles
Specialisation of HighLevelGpuProgram to provide support for OpenGL Shader Language (GLSL ES) for Ope...
Command object for setting profiles.
vector< String >::type StringVector
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:79
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
Defines a generic resource handler.
void setEntryPoint(const String &entryPoint)
Sets the entry point for this program ie the first method called.
_StringBase String
static CmdEntryPoint msCmdEntryPoint
Command object for setting entry point.
Abstract class which is command object which gets/sets parameters.
Specialisation of HighLevelGpuProgram to provide support for CG.