Workspace 6.21.5
Public Member Functions | List of all members
WSGLShaderProgram Class Reference

Represents an OpenGL shader program present on a particular context.

#include <Rendering/OpenGL/Shaders/wsglshaderprogram.h>

Inheritance diagram for WSGLShaderProgram:
[legend]

Public Member Functions

 WSGLShaderProgram (const QOpenGLContext *context=nullptr, QObject *parent=nullptr)
 
 WSGLShaderProgram (QObject *parent)
 
 ~WSGLShaderProgram () override
 
bool activateCapabilities (WSGLRenderer &renderer)
 
bool addCapability (WSGLShaderProgramCapability *capability)
 
bool bindTextureCoordBuffer (int location, WSGLRenderer &renderer, Texturizer &texturizer, WSGLRenderItem &item, Shader &shader)
 
void clearInternalLog ()
 
bool compileAndLink (const QString &vertexShaderFileName, const QString &fragmentShaderFileName, const QString &geometryShaderFileName, const QVariantMap &preprocessorDefinitions=QVariantMap())
 
bool compileAndLink (const QString &vertexShaderFileName, const QString &fragmentShaderFileName, const QVariantMap &preprocessorDefinitions=QVariantMap())
 
bool deactivateCapabilities (WSGLRenderer &renderer)
 
const QString & getInternalLog (const Application::LogManager::MessageCategory &category) const
 
bool getUseInternalLog () const
 
bool isValid ()
 
bool renderGlyphs (WSGLRenderer &renderer, WSGLRenderItem &item, RenderGlyphCallback *perGlyphCallback=nullptr, const WSGLRenderElementsFilter *elementFilter=nullptr)
 
bool renderItem (WSGLRenderer &renderer, WSGLRenderItem &item, const WSGLRenderElementsFilter *elementFilter=nullptr)
 
bool renderUsingCustomFunction (WSGLRenderer &renderer, WSGLRenderItem &item, CustomRenderFunction &function)
 
void setUniformValue (int location, const Mesh::TransformMatrix &value)
 
void setUniformValue (int location, const Mesh::Vector3d &value)
 
void setUseInternalLog (bool b)
 
- Public Member Functions inherited from BasicTextLogger
 BasicTextLogger ()
 
virtual ~BasicTextLogger ()
 
void logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const
 
void logLine (const QString &msg) const
 
void logText (const Application::LogManager::MessageCategory &category, const QString &msg) const
 
void logText (const QString &msg) const
 

Constructor & Destructor Documentation

◆ WSGLShaderProgram() [1/2]

WSGLShaderProgram ( QObject *  parent)
explicit

◆ WSGLShaderProgram() [2/2]

WSGLShaderProgram ( const QOpenGLContext *  context = nullptr,
QObject *  parent = nullptr 
)
explicit

◆ ~WSGLShaderProgram()

~WSGLShaderProgram ( )
override

Member Function Documentation

◆ activateCapabilities()

bool activateCapabilities ( WSGLRenderer renderer)

◆ addCapability()

bool addCapability ( WSGLShaderProgramCapability capability)

Adds a capability to the program. When the program is activated, deactivated or an item is rendered, this capability will be included in this process.

Note
Capabilitys can depend on other capabilities. This function will return false if a capability's dependencies have not already been added.

◆ bindTextureCoordBuffer()

bool bindTextureCoordBuffer ( int  location,
WSGLRenderer renderer,
Texturizer texturizer,
WSGLRenderItem renderItem,
Shader shader 
)
Parameters
locationThe vertex attribute location to which the buffer will be bound.
rendererThe renderer to which the buffer will be bound.
texturizerThe texturizer which contains details of how to get texture coordinates.
renderItemThe render item for which the coordinates are being generated.
shaderThe shader being used to bind the coord buffer

Looks up (or creates) a texture coordinate buffer using the details provided by texturizer, the model referenced by renderItem and binds it to the vertex attribute location specified by location.

Returns
true if the buffer was able to be bound successfully, false otherwise.

◆ clearInternalLog()

void clearInternalLog ( )

◆ compileAndLink() [1/2]

bool compileAndLink ( const QString &  vertexShaderFileName,
const QString &  fragmentShaderFileName,
const QString &  geometryShaderFileName,
const QVariantMap &  preprocessorDefinitions = QVariantMap() 
)

◆ compileAndLink() [2/2]

bool compileAndLink ( const QString &  vertexShaderFileName,
const QString &  fragmentShaderFileName,
const QVariantMap &  preprocessorDefinitions = QVariantMap() 
)

◆ deactivateCapabilities()

bool deactivateCapabilities ( WSGLRenderer renderer)

◆ getInternalLog()

const QString & getInternalLog ( const Application::LogManager::MessageCategory category) const
Parameters
categoryThe desired message category.
Returns
The message log contents for the specific category.

◆ getUseInternalLog()

bool getUseInternalLog ( ) const

◆ isValid()

bool isValid ( )

Checks whether or not the program is valid and ready to execute (see glValidateProgram). It also takes into account whether or not all of the required uniforms have been set. It will also print any validation problems (if they exist) to the log.

NOTE: Since this is invoking a series of 'get' calls, it is recommended it be used only during debug builds.

Returns
true if the program is ready to execute.

◆ renderGlyphs()

bool renderGlyphs ( WSGLRenderer renderer,
WSGLRenderItem item,
RenderGlyphCallback perGlyphCallback = nullptr,
const WSGLRenderElementsFilter elementFilter = nullptr 
)

◆ renderItem()

bool renderItem ( WSGLRenderer renderer,
WSGLRenderItem item,
const WSGLRenderElementsFilter elementFilter = nullptr 
)

◆ renderUsingCustomFunction()

bool renderUsingCustomFunction ( WSGLRenderer renderer,
WSGLRenderItem item,
CustomRenderFunction function 
)

◆ setUniformValue() [1/2]

void setUniformValue ( int  location,
const Mesh::TransformMatrix value 
)

◆ setUniformValue() [2/2]

void setUniformValue ( int  location,
const Mesh::Vector3d value 
)

◆ setUseInternalLog()

void setUseInternalLog ( bool  b)