home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 27 / develop issue 27 code / 3d game controls / source / draw.c < prev    next >
Encoding:
Text File  |  1996-06-29  |  1.1 KB  |  37 lines

  1. //--------------------------------------------------------------------------------------------
  2. //  3D Drawing Code
  3. //
  4. //      by Philip McBride
  5. //        parts freely taken from Apple DTS sample code
  6. //
  7. //--------------------------------------------------------------------------------------------
  8.  
  9.  
  10. #include "GameControls.h"
  11. #include "extern.h"
  12. #include "draw.h"
  13.  
  14. //--------------------------------------------------------------------------------------------
  15. //  Update the Screen (by re-rendering the scene)
  16. //
  17. void MyUpdateScreen(DocumentPtr theDocument)
  18. {    
  19.     TQ3SubdivisionStyleData subData = {kQ3SubdivisionMethodConstant, 20, 20};
  20.     
  21.     if (theDocument == NULL)
  22.         return;
  23.  
  24.     if( theDocument->documentGroup ) {
  25.         Q3View_StartRendering(theDocument->theView );
  26.         do {
  27.     
  28.             Q3Shader_Submit(theDocument->illuminationShader, theDocument->theView);
  29.             Q3InterpolationStyle_Submit(theDocument->currentInterpolation,theDocument->theView);
  30.             Q3SubdivisionStyle_Submit( &subData,theDocument->theView);
  31.             Q3DisplayGroup_Submit(theDocument->documentGroup, theDocument->theView);
  32.             
  33.         } while (Q3View_EndRendering(theDocument->theView) == kQ3ViewStatusRetraverse );
  34.     }
  35.     
  36.     return;
  37. }