Skip to content

Commit

Permalink
Apply clang-format to header files of GL3+ (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Dec 29, 2021
1 parent 917edba commit 8933f0d
Show file tree
Hide file tree
Showing 66 changed files with 1,633 additions and 1,603 deletions.
10 changes: 4 additions & 6 deletions RenderSystems/GL3Plus/include/GLSL/OgreGLSLExtSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
-----------------------------------------------------------------------------
*/



#ifndef __GLSLExtSupport_H__
#define __GLSLExtSupport_H__

Expand All @@ -38,7 +36,7 @@
//
namespace Ogre
{
//TODO Get rid of any unneeded forward declarations.
// TODO Get rid of any unneeded forward declarations.
// forward declarations
class GLSLShader;
class GLSLMonolithicProgram;
Expand All @@ -49,8 +47,8 @@ namespace Ogre
@param msg The info log message string is appended to this string
@param obj The GL object that is used to retrieve the info log
*/
String logObjectInfo(const String& msg, const GLuint obj);
String logObjectInfo( const String &msg, const GLuint obj );

} // namespace Ogre
} // namespace Ogre

#endif // __GLSLExtSupport_H__
#endif // __GLSLExtSupport_H__
27 changes: 13 additions & 14 deletions RenderSystems/GL3Plus/include/GLSL/OgreGLSLMonolithicProgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@
#define __GLSLMonolithicProgram_H__

#include "OgreGL3PlusPrerequisites.h"

#include "OgreGLSLProgram.h"
#include "OgreGpuProgram.h"
#include "OgreHardwareVertexBuffer.h"
#include "OgreGLSLProgram.h"

namespace Ogre {

namespace Ogre
{
class GLSLShader;

/** Model of OpenGL program object created using the glLinkProgram
method of linking.
Linking using glLinkProgram is supported by OpenGL 2.0 and up,
but does not allow hot-swapping shaders without recompiling
the program object like GLSLSeparableProgram can. Hence the name
Expand All @@ -57,12 +58,9 @@ namespace Ogre {

public:
/// Constructor should only be used by GLSLMonolithicProgramManager
GLSLMonolithicProgram(GLSLShader* vertexProgram,
GLSLShader* hullProgram,
GLSLShader* domainProgram,
GLSLShader* geometryProgram,
GLSLShader* fragmentProgram,
GLSLShader* computeProgram);
GLSLMonolithicProgram( GLSLShader *vertexProgram, GLSLShader *hullProgram,
GLSLShader *domainProgram, GLSLShader *geometryProgram,
GLSLShader *fragmentProgram, GLSLShader *computeProgram );
~GLSLMonolithicProgram();

/** Makes a program object active by making sure it is linked
Expand All @@ -75,16 +73,17 @@ namespace Ogre {
GLSLShader::bindParameters() just before rendering
occurs.
*/
void updateUniforms(GpuProgramParametersSharedPtr params, uint16 mask, GpuProgramType fromProgType) override;
void updateUniforms( GpuProgramParametersSharedPtr params, uint16 mask,
GpuProgramType fromProgType ) override;

/** Updates program object uniforms using data from pass
iteration GpuProgramParameters. normally called by
GLSLShader::bindMultiPassParameters() just before multi
pass rendering occurs.
*/
void updatePassIterationUniforms(GpuProgramParametersSharedPtr params) override;
void updatePassIterationUniforms( GpuProgramParametersSharedPtr params ) override;
};

}
} // namespace Ogre

#endif // __GLSLMonolithicProgram_H__
#endif // __GLSLMonolithicProgram_H__
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
#define __GLSLMonolithicProgramManager_H__

#include "OgreGL3PlusPrerequisites.h"
#include "OgreSingleton.h"

#include "OgreGLSLExtSupport.h"
#include "OgreGLSLMonolithicProgram.h"
#include "OgreGLSLProgramManager.h"
#include "OgreSingleton.h"

namespace Ogre {

namespace Ogre
{
/** Ogre assumes that there are separate vertex and fragment
programs to deal with but GLSL has one program object that
represents the active vertex and fragment shader objects
Expand All @@ -52,73 +52,72 @@ namespace Ogre {
retrieval the next time the program object is required.
*/

class _OgreGL3PlusExport GLSLMonolithicProgramManager : public GLSLProgramManager, public Singleton<GLSLMonolithicProgramManager>
class _OgreGL3PlusExport GLSLMonolithicProgramManager
: public GLSLProgramManager,
public Singleton<GLSLMonolithicProgramManager>
{

private:

typedef map<uint32, GLSLMonolithicProgram*>::type MonolithicProgramMap;
typedef MonolithicProgramMap::iterator MonolithicProgramIterator;
typedef map<uint32, GLSLMonolithicProgram *>::type MonolithicProgramMap;
typedef MonolithicProgramMap::iterator MonolithicProgramIterator;

/// container holding previously created program objects
MonolithicProgramMap mMonolithicPrograms;

/// active objects defining the active rendering gpu state
GLSLMonolithicProgram* mActiveMonolithicProgram;
GLSLMonolithicProgram *mActiveMonolithicProgram;

public:

GLSLMonolithicProgramManager(const GL3PlusSupport& support);
GLSLMonolithicProgramManager( const GL3PlusSupport &support );

~GLSLMonolithicProgramManager();

/** Get the program object that links the two active shader
objects together if a program object was not already
created and linked a new one is created and linked
*/
GLSLMonolithicProgram* getActiveMonolithicProgram();
GLSLMonolithicProgram *getActiveMonolithicProgram();

/** Set the active vertex shader for the next rendering state.
The active program object will be cleared. Normally
called from the GLSLShader::bindProgram and
unbindProgram methods
*/
void setActiveVertexShader(GLSLShader* vertexGpuProgram);
void setActiveVertexShader( GLSLShader *vertexGpuProgram );
/** Set the active hull(control) shader for the next rendering
state. The active program object will be cleared.
Normally called from the GLSLShader::bindProgram and
unbindProgram methods
*/
void setActiveHullShader(GLSLShader* hullGpuProgram);
void setActiveHullShader( GLSLShader *hullGpuProgram );
/** Set the active domain(evaluation) shader for the next
rendering state. The active program object will be
cleared. Normally called from the
GLSLShader::bindProgram and unbindProgram methods
*/
void setActiveDomainShader(GLSLShader* domainGpuProgram);
void setActiveDomainShader( GLSLShader *domainGpuProgram );
/** Set the active geometry shader for the next rendering
state. The active program object will be cleared.
Normally called from the GLSLShader::bindProgram and
unbindProgram methods
*/
void setActiveGeometryShader(GLSLShader* geometryGpuProgram);
void setActiveGeometryShader( GLSLShader *geometryGpuProgram );
/** Set the active fragment shader for the next rendering
state. The active program object will be cleared.
Normally called from the GLSLShader::bindProgram and
unbindProgram methods
*/
void setActiveFragmentShader(GLSLShader* fragmentGpuProgram);
void setActiveFragmentShader( GLSLShader *fragmentGpuProgram );
/** Set the active compute shader for the next rendering
state. The active program object will be cleared.
Normally called from the GLSLShader::bindProgram and
unbindProgram methods
*/
void setActiveComputeShader(GLSLShader* computeGpuProgram);
void setActiveComputeShader( GLSLShader *computeGpuProgram );

static GLSLMonolithicProgramManager& getSingleton();
static GLSLMonolithicProgramManager* getSingletonPtr();
static GLSLMonolithicProgramManager &getSingleton();
static GLSLMonolithicProgramManager *getSingletonPtr();
};

}
} // namespace Ogre

#endif // __GLSLMonolithicProgramManager_H__
#endif // __GLSLMonolithicProgramManager_H__
Loading

0 comments on commit 8933f0d

Please sign in to comment.