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__
static GLuint mDomainShaderCount
Keep track of the number of tesselation domain(evaluation) shaders created.
GLint mLinked
Flag indicating that the program object has been successfully linked.
Specialisation of HighLevelGpuProgram to provide support for OpenGL Shader Language (GLSL)...
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
#define _OgreGL3PlusExport
GLSL low level compiled shader object - this class is used to get at the linked program object and pr...
GLSLProgram * getGLSLProgram(void) const
Get the GLSLProgram for the shader object.
static GLuint mComputeShaderCount
Keep track of the number of compute shaders created.
static GLuint mFragmentShaderCount
Keep track of the number of fragment shaders created.
static GLuint mGeometryShaderCount
Keep track of the number of geometry shaders created.
static GLuint mVertexShaderCount
Keep track of the number of vertex shaders created.
void setLinked(GLint flag)
Set the programs link status Only used when programs are linked separately with GL_ARB_separate_shade...
static GLuint mHullShaderCount
Keep track of the number of tesselation hull(control) shaders created.
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
GLint isLinked(void)
Return the programs link status Only used when programs are linked separately with GL_ARB_separate_sh...
GLSLProgram * mGLSLProgram
GL Handle for the shader object.
unsigned short uint16
Definition: OgrePlatform.h:360

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 Sun Oct 22 2017 04:04:15