All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::OpacityGuard Class Reference

This class provides a simple guard for setting opacity. More...

#include <Luminous/RenderContext.hpp>

Inheritance diagram for Luminous::OpacityGuard:
Patterns::NotCopyable

Public Member Functions

 OpacityGuard (RenderContext &r, float opacity)
 Construct a new guard. More...
 
 OpacityGuard (OpacityGuard &&o)
 Construct a guard by moving. More...
 
 ~OpacityGuard ()
 Destructor. This function automatically calls RenderContext::popOpacity().
 

Detailed Description

This class provides a simple guard for setting opacity.

It will automatically pop opacity in its destructor so the user doesn't need to remember to do it manually. It is equivalent to calling "RenderContext::pushOpacity(float)" and "RenderContext::popOpacity"

Constructor & Destructor Documentation

Luminous::OpacityGuard::OpacityGuard ( RenderContext r,
float  opacity 
)
inline

Construct a new guard.

Parameters
rrender context
Luminous::OpacityGuard::OpacityGuard ( OpacityGuard &&  o)
inline

Construct a guard by moving.

Parameters
oguard to move