How to turn a pfSwitch Node On or Off

 

Vega Code Example

 

 

 

 

 

 
 

This simple example function illustrates how to turn a  Performer  Switch Node (pfSwitch)   on and off 

 

Use findNamedSwitchNodeInVgObject to find a pfSwitch instance

 

 
   
 

 

 
 
 
 

#include "vg.h"          // Required for the standard Vega classes
#include "pf.h"          // Required for the standard Performer classes

void
turnSwitchOnOff(pfSwitch *swNode, const bool state ){
// ##################################################
// #
// # Public function
// #
// #    Toggle the passed switch between On or Off
// #    
// ##################################################

 

    //

    // Sanity check we need a pointer

    //

    if( swNode == NULL )

        return;

 

    if( state == true ) {

        pfSwitchVal( swNode, PFSWITCH_ON);

        }

    else{

        pfSwitchVal( swNode, PFSWITCH_OFF);

    }

 

 

} // turnSwitchOnOff

 

 

 
 

 

 

© Copyright 2004 Gordon Tomlinson  All Rights Reserved.

All logos, trademarks and copyrights in this site are property of their respective owner.