Back to index

nux  3.0.0
Public Member Functions | Public Attributes
nux::BlendOperator Class Reference

#include <GraphicsEngine.h>

List of all members.

Public Member Functions

 BlendOperator ()
 ~BlendOperator ()
void EnableBlending (bool enable)
void SetPorterDuffOperator (PorterDuffOperator op)
void SetCustomBlendOperator (unsigned int src_blend, unsigned int dst_blend)

Public Attributes

bool _enable
unsigned int _src_blend
unsigned int _dst_blend

Detailed Description

Definition at line 81 of file GraphicsEngine.h.


Constructor & Destructor Documentation

Definition at line 41 of file GraphicsEngine.cpp.

  {
    _enable = true;
    _src_blend = GL_ONE;
    _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
  }

Definition at line 48 of file GraphicsEngine.cpp.

  {
    _enable = true;
    _src_blend = GL_ONE;
    _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
  }

Member Function Documentation

void nux::BlendOperator::EnableBlending ( bool  enable)

Definition at line 55 of file GraphicsEngine.cpp.

  {
    _enable = enable;
  }

Here is the caller graph for this function:

void nux::BlendOperator::SetCustomBlendOperator ( unsigned int  src_blend,
unsigned int  dst_blend 
)

Definition at line 124 of file GraphicsEngine.cpp.

  {

  }

Definition at line 60 of file GraphicsEngine.cpp.

  {
    switch(op)
    {
    case CLEAR:
      _src_blend = GL_ZERO;
      _dst_blend = GL_ZERO;
      break;
    case SRC:
      _src_blend = GL_ONE;
      _dst_blend = GL_ZERO;
      break;
    case DST:
      _src_blend = GL_ZERO;
      _dst_blend = GL_ONE;
      break;
    case SRC_OVER:
      _src_blend = GL_ONE;
      _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
      break;
    case DST_OVER:
      _src_blend = GL_ONE_MINUS_DST_ALPHA;
      _dst_blend = GL_ONE;
      break;
    case SRC_IN:
      _src_blend = GL_DST_ALPHA;
      _dst_blend = GL_ZERO;
      break;
    case DST_IN:
      _src_blend = GL_ZERO;
      _dst_blend = GL_SRC_ALPHA;
      break;
    case SRC_OUT:
      _src_blend = GL_ONE_MINUS_DST_ALPHA;
      _dst_blend = GL_ZERO;
      break;
    case DST_OUT:
      _src_blend = GL_ZERO;
      _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
      break;
    case SRC_ATOP:
      _src_blend = GL_DST_ALPHA;
      _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
      break;
    case DST_ATOP:
      _src_blend = GL_ONE_MINUS_DST_ALPHA;
      _dst_blend = GL_SRC_ALPHA;
      break;
    case XOR:
      _src_blend = GL_ONE_MINUS_DST_ALPHA;
      _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
      break;
    case PLUS:
      _src_blend = GL_ONE;
      _dst_blend = GL_ONE;
      break;
    default:
      // Use SRC_OVER
      _src_blend = GL_ONE;
      _dst_blend = GL_ONE_MINUS_SRC_ALPHA;
      break;
    }
  }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 93 of file GraphicsEngine.h.

Definition at line 91 of file GraphicsEngine.h.

Definition at line 92 of file GraphicsEngine.h.


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