pfSwitchVal problems

New Message Reply Date view Thread view Subject view Author view

Talal Nehme (talal++at++pdq.net)
Wed, 7 Apr 1999 09:19:28 -0500


Hi,
I am fairly new to Performer, I couldn't set the values of any switches in
my scene, so I tried an example from the manual to make sure the error was
not in my code, and it still didn't work, I'm trying to fidn out what I am
doing wrong, any help is appreciated

 //
  float sCurrVal;
  int result;
  pfSwitch *sample_sw;
  pfSequence *explosion1_seq, *explosion2_seq;

  sample_sw = pfNewSwitch();
  explosion1_seq = pfNewSeq();
  explosion2_seq = pfNewSeq();

  pfAddChild(sample_sw, explosion1_seq);
  pfAddChild(sample_sw, explosion2_seq);

  result = pfGetNumChildren(sample_sw);
  fprintf(stderr,"switch has %d children\n",result);

  sCurrVal = pfGetSwitchVal(sample_sw);
  fprintf(stderr,"switchval = %f\n",sCurrVal);

  pfSwitchVal(sample_sw, 1); //set to 1
  sCurrVal = pfGetSwitchVal(sample_sw);
  fprintf(stderr,"switchval = %f\n",sCurrVal);
//
  The output I get is:
  switch has 2 children
  switchval = 0.000000
  switchval = 0.000000

Talal++at++pdq.net


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Apr 07 1999 - 07:19:36 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.