[kwinglutils] Add a ShaderTraits variant to ShaderBinder
Simplifies binding a Shader with traits.
This commit is contained in:
parent
fbd1122a15
commit
778a7fd1a0
1 changed files with 15 additions and 0 deletions
|
@ -443,6 +443,14 @@ public:
|
||||||
* @see ShaderManager::pushShader
|
* @see ShaderManager::pushShader
|
||||||
**/
|
**/
|
||||||
explicit ShaderBinder(GLShader *shader);
|
explicit ShaderBinder(GLShader *shader);
|
||||||
|
/**
|
||||||
|
* @brief Pushes the Shader with the given @p traits to the ShaderManager's stack.
|
||||||
|
*
|
||||||
|
* @param traits The traits describing the shader
|
||||||
|
* @see ShaderManager::pushShader
|
||||||
|
* @since 5.6
|
||||||
|
**/
|
||||||
|
explicit ShaderBinder(ShaderTraits traits);
|
||||||
~ShaderBinder();
|
~ShaderBinder();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -468,6 +476,13 @@ ShaderBinder::ShaderBinder(GLShader *shader)
|
||||||
ShaderManager::instance()->pushShader(shader);
|
ShaderManager::instance()->pushShader(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
ShaderBinder::ShaderBinder(ShaderTraits traits)
|
||||||
|
: m_shader(nullptr)
|
||||||
|
{
|
||||||
|
m_shader = ShaderManager::instance()->pushShader(traits);
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
ShaderBinder::~ShaderBinder()
|
ShaderBinder::~ShaderBinder()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue