OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLSLLinkProgram.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-2013 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 __GLSLLinkProgram_H__
29 #define __GLSLLinkProgram_H__
30 
31 #include "OgreGLPrerequisites.h"
32 #include "OgreGpuProgram.h"
34 
35 namespace Ogre {
38  {
40  GLint mLocation;
45  };
46 
48  typedef GLUniformReferenceList::iterator GLUniformReferenceIterator;
49 
55  {
56  private:
59 
66 
70  GLhandleARB mGLHandle;
72  GLint mLinked;
77 
79  void buildGLUniformReferences(void);
81  void extractAttributes(void);
82 
86 
89  {
91  GLuint attrib;
92  CustomAttribute(const String& _name, GLuint _attrib)
93  :name(_name), attrib(_attrib) {}
94  };
95 
96  static CustomAttribute msCustomAttributes[];
97 
98  String getCombinedName();
100  void compileAndLink();
102  void getMicrocodeFromCache();
103  public:
105  GLSLLinkProgram(GLSLGpuProgram* vertexProgram, GLSLGpuProgram* geometryProgram, GLSLGpuProgram* fragmentProgram);
106  ~GLSLLinkProgram(void);
107 
111  void activate(void);
112 
116  void updateUniforms(GpuProgramParametersSharedPtr params, uint16 mask, GpuProgramType fromProgType);
120  void updatePassIterationUniforms(GpuProgramParametersSharedPtr params);
122  GLhandleARB getGLHandle(void) const { return mGLHandle; }
129  void setSkeletalAnimationIncluded(bool included)
130  { mSkeletalAnimation = included; }
131 
138  bool isSkeletalAnimationIncluded(void) const { return mSkeletalAnimation; }
139 
141  GLuint getAttributeIndex(VertexElementSemantic semantic, uint index);
143  bool isAttributeValid(VertexElementSemantic semantic, uint index);
144 
145  };
146 
147 }
148 
149 #endif // __GLSLLinkProgram_H__
const GpuConstantDefinition * mConstantDef
The constant definition it relates to.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
Structure used to keep track of named uniforms in the linked program object.
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
GLSL low level compiled shader object - this class is used to get at the linked program object and pr...
#define _OgreGLExport
GLUniformReferenceList::iterator GLUniformReferenceIterator
vector< GLUniformReference >::type GLUniformReferenceList
GLint mLocation
GL location handle.
Information about predefined program constants.
_StringBase String
unsigned short uint16
Definition: OgrePlatform.h:271
GpuProgramType mSourceProgType
Which type of program params will this value come from?
unsigned int uint