Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

  1. /**************************************************************************
  2. * *
  3. * Copyright (C) 1992, Silicon Graphics, Inc. *
  4. * *
  5. * These coded instructions, statements, and computer programs contain *
  6. * unpublished proprietary information of Silicon Graphics, Inc., and *
  7. * are protected by Federal copyright law. They may not be disclosed *
  8. * to third parties or copied or duplicated in any form, in whole or *
  9. * in part, without the prior written consent of Silicon Graphics, Inc. *
  10. * *
  11. **************************************************************************/
  12. /*
  13. * displaylist.c++ - $Revision: 1.4 $
  14. * Derrick Burns - 1991
  15. */
  16. #include "glimport.h"
  17. #include "mystdio.h"
  18. #include "nurbstes.h"
  19. #include "displayl.h"
  20. DisplayList::DisplayList( NurbsTessellator *_nt ) :
  21. dlnodePool( sizeof( Dlnode ), 1, "dlnodepool" )
  22. {
  23. lastNode = &nodes;
  24. nt = _nt;
  25. }
  26. DisplayList::~DisplayList( void )
  27. {
  28. for( Dlnode *nextNode; nodes; nodes = nextNode ) {
  29. nextNode = nodes->next;
  30. if( nodes->cleanup != 0 ) (nt->*nodes->cleanup)( nodes->arg );
  31. //nodes->deleteMe(dlnodePool);
  32. }
  33. }
  34. void
  35. DisplayList::play( void )
  36. {
  37. for( Dlnode *node = nodes; node; node = node->next )
  38. if( node->work != 0 ) (nt->*node->work)( node->arg );
  39. }
  40. void
  41. DisplayList::endList( void )
  42. {
  43. *lastNode = 0;
  44. }
  45. void
  46. DisplayList::append( PFVS work, void *arg, PFVS cleanup )
  47. {
  48. Dlnode *node = new(dlnodePool) Dlnode( work, arg, cleanup );
  49. *lastNode = node;
  50. lastNode = &(node->next);
  51. }