Plus/src/GLSL/include/OgreGLSLGpuProgram.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 
29 #ifndef __GLSLGpuProgram_H__
30 #define __GLSLGpuProgram_H__
31 
32 // Precompiler options
33 #include "OgreGLSLExtSupport.h"
34 #include "OgreGL3PlusGpuProgram.h"
35 
36 
37 namespace Ogre {
38 
49  {
50  private:
53 
55  static GLuint mVertexShaderCount;
57  static GLuint mFragmentShaderCount;
59  static GLuint mGeometryShaderCount;
61  static GLuint mHullShaderCount;
63  static GLuint mDomainShaderCount;
65  static GLuint mComputeShaderCount;
66 
70  GLint mLinked;
71 
72  public:
73  GLSLGpuProgram(GLSLProgram* parent);
74  ~GLSLGpuProgram();
75 
76 
78  void bindProgram(void);
80  void unbindProgram(void);
82  void bindProgramParameters(GpuProgramParametersSharedPtr params, uint16 mask);
84  void bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params);
86  void bindProgramSharedParameters(GpuProgramParametersSharedPtr params, uint16 mask);
87 
89  GLSLProgram* getGLSLProgram(void) const { return mGLSLProgram; }
90 
94  GLint isLinked(void) { return mLinked; }
95 
99  void setLinked(GLint flag) { mLinked = flag; }
100 
101  protected:
103  void loadFromSource(void);
105  void unloadImpl(void);
107  void loadImpl(void);
108  };
109 }
110 
111 #endif // __GLSLGpuProgram_H__
OgreGLSLExtSupport.h
Ogre::GLSLGpuProgram::mHullShaderCount
static GLuint mHullShaderCount
Keep track of the number of tesselation hull(control) shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:61
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GLSLGpuProgram::mVertexShaderCount
static GLuint mVertexShaderCount
Keep track of the number of vertex shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:55
Ogre::GLSLGpuProgram::isLinked
GLint isLinked(void)
Return the programs link status Only used when programs are linked separately with GL_ARB_separate_sh...
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:94
Ogre::GLSLGpuProgram::setLinked
void setLinked(GLint flag)
Set the programs link status Only used when programs are linked separately with GL_ARB_separate_shade...
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:99
Ogre::uint16
unsigned short uint16
Definition: OgrePlatform.h:360
Ogre::GLSLGpuProgram::mGLSLProgram
GLSLProgram * mGLSLProgram
GL Handle for the shader object.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:52
Ogre::GLSLGpuProgram::getGLSLProgram
GLSLProgram * getGLSLProgram(void) const
Get the GLSLProgram for the shader object.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:89
Ogre::GLSLGpuProgram::mGeometryShaderCount
static GLuint mGeometryShaderCount
Keep track of the number of geometry shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:59
Ogre::GLSLGpuProgram::mDomainShaderCount
static GLuint mDomainShaderCount
Keep track of the number of tesselation domain(evaluation) shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:63
Ogre::GLSLGpuProgram::mFragmentShaderCount
static GLuint mFragmentShaderCount
Keep track of the number of fragment shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:57
_OgreGL3PlusExport
#define _OgreGL3PlusExport
Definition: OgreGL3PlusPrerequisites.h:91
Ogre::GLSLGpuProgram
GLSL low level compiled shader object - this class is used to get at the linked program object and pr...
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:48
OgreGL3PlusGpuProgram.h
Ogre::GLSLProgram
Specialisation of HighLevelGpuProgram to provide support for OpenGL Shader Language (GLSL).
Definition: Plus/src/GLSL/include/OgreGLSLProgram.h:56
Ogre::GLSLGpuProgram::mLinked
GLint mLinked
Flag indicating that the program object has been successfully linked.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:70
Ogre::SharedPtr< GpuProgramParameters >
Ogre::GL3PlusGpuProgram
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV)
Definition: OgreGL3PlusGpuProgram.h:39
Ogre::GLSLGpuProgram::mComputeShaderCount
static GLuint mComputeShaderCount
Keep track of the number of compute shaders created.
Definition: Plus/src/GLSL/include/OgreGLSLGpuProgram.h:65

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15