KWin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KWin::ShaderBinder Class Reference

#include <glshadermanager.h>

Public Member Functions

 ShaderBinder (GLShader *shader)
 Pushes the given shader to the ShaderManager's stack.
 
 ShaderBinder (ShaderTraits traits)
 Pushes the Shader with the given traits to the ShaderManager's stack.
 
 ~ShaderBinder ()
 
GLShadershader ()
 

Detailed Description

An helper class to push a Shader on to ShaderManager's stack and ensuring that the Shader gets popped again from the stack automatically once the object goes out of life.

How to use:

{
GLShader *myCustomShaderIWantToPush;
ShaderBinder binder(myCustomShaderIWantToPush);
// do stuff with the shader being pushed on the stack
}
// here the Shader is automatically popped as helper does no longer exist.
Since
4.10

Definition at line 181 of file glshadermanager.h.

Constructor & Destructor Documentation

◆ ShaderBinder() [1/2]

KWin::ShaderBinder::ShaderBinder ( GLShader * shader)
inlineexplicit

Pushes the given shader to the ShaderManager's stack.

Parameters
shaderThe Shader to push on the stack
See also
ShaderManager::pushShader

Definition at line 210 of file glshadermanager.h.

◆ ShaderBinder() [2/2]

KWin::ShaderBinder::ShaderBinder ( ShaderTraits traits)
inlineexplicit

Pushes the Shader with the given traits to the ShaderManager's stack.

Parameters
traitsThe traits describing the shader
See also
ShaderManager::pushShader
Since
5.6

Definition at line 216 of file glshadermanager.h.

◆ ~ShaderBinder()

KWin::ShaderBinder::~ShaderBinder ( )
inline

Definition at line 222 of file glshadermanager.h.

Member Function Documentation

◆ shader()

GLShader * KWin::ShaderBinder::shader ( )
inline
Returns
The Shader pushed to the Stack.

Definition at line 227 of file glshadermanager.h.


The documentation for this class was generated from the following file: