SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLDrawBits Class Reference

Drawing states stored in the bits of an unsigned int. More...

#include <SLDrawBits.h>

Public Member Functions

 SLDrawBits ()
 
 ~SLDrawBits ()
 
void allOff ()
 Turns all bits off. More...
 
void on (SLuint bit)
 Turns the specified bit on. More...
 
void off (SLuint bit)
 Turns the specified bit off. More...
 
void set (SLuint bit, SLbool state)
 Sets the specified bit to the passed state. More...
 
void toggle (SLuint bit)
 Toggles the specified bit. More...
 
SLbool get (SLuint bit)
 Returns the specified bit. More...
 
SLuint bits ()
 Returns the all bits. More...
 
void bits (SLuint b)
 Set all bits. More...
 

Private Attributes

SLuint _bits
 Drawing flags as a unsigned 32-bit register. More...
 

Detailed Description

Drawing states stored in the bits of an unsigned int.

The drawing bits can be applied to the entire scene, a group or a mesh. The default value is 0 signifying the default state. See the defines above for the different drawing bit flags.

Definition at line 41 of file SLDrawBits.h.

Constructor & Destructor Documentation

◆ SLDrawBits()

SLDrawBits::SLDrawBits ( )
inline

Definition at line 44 of file SLDrawBits.h.

44 { _bits = 0; }
SLuint _bits
Drawing flags as a unsigned 32-bit register.
Definition: SLDrawBits.h:78

◆ ~SLDrawBits()

SLDrawBits::~SLDrawBits ( )
inline

Definition at line 45 of file SLDrawBits.h.

45 { ; }

Member Function Documentation

◆ allOff()

void SLDrawBits::allOff ( )
inline

Turns all bits off.

Definition at line 48 of file SLDrawBits.h.

48 { _bits = 0; }

◆ bits() [1/2]

SLuint SLDrawBits::bits ( )
inline

Returns the all bits.

Definition at line 72 of file SLDrawBits.h.

72 { return _bits; }

◆ bits() [2/2]

void SLDrawBits::bits ( SLuint  b)
inline

Set all bits.

Definition at line 75 of file SLDrawBits.h.

75 { _bits = b; }

◆ get()

SLbool SLDrawBits::get ( SLuint  bit)
inline

Returns the specified bit.

Definition at line 69 of file SLDrawBits.h.

69 { return (_bits & bit) ? true : false; }

◆ off()

void SLDrawBits::off ( SLuint  bit)
inline

Turns the specified bit off.

Definition at line 54 of file SLDrawBits.h.

54 { SL_DELBIT(_bits, bit); }
#define SL_DELBIT(VAR, VAL)
Definition: SL.h:225

◆ on()

void SLDrawBits::on ( SLuint  bit)
inline

Turns the specified bit on.

Definition at line 51 of file SLDrawBits.h.

51 { SL_SETBIT(_bits, bit); }
#define SL_SETBIT(VAR, VAL)
Definition: SL.h:224

◆ set()

void SLDrawBits::set ( SLuint  bit,
SLbool  state 
)
inline

Sets the specified bit to the passed state.

Definition at line 57 of file SLDrawBits.h.

58  {
59  if (state)
60  SL_SETBIT(_bits, bit);
61  else
62  SL_DELBIT(_bits, bit);
63  }

◆ toggle()

void SLDrawBits::toggle ( SLuint  bit)
inline

Toggles the specified bit.

Definition at line 66 of file SLDrawBits.h.

66 { SL_TOGBIT(_bits, bit); }
#define SL_TOGBIT(VAR, VAL)
Definition: SL.h:226

Member Data Documentation

◆ _bits

SLuint SLDrawBits::_bits
private

Drawing flags as a unsigned 32-bit register.

Definition at line 78 of file SLDrawBits.h.


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