home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickDraw3D 1.6 SDK / Mac SampleCode New for 1.6 / CompressedPixmapSample / Source / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  2.0 KB  |  110 lines  |  [TEXT/CWIE]

  1. /****************************/
  2. /*  COMPRESSED PIXMAP TEST  */
  3. /* By Brian Greenstone      */
  4. /****************************/
  5.  
  6.  
  7. /****************************/
  8. /*    EXTERNALS             */
  9. /****************************/
  10. #include <Fonts.h>
  11. #include <Dialogs.h>
  12. #include <Windows.h>
  13. #include <Gestalt.h>
  14.  
  15. #include "myglobals.h"
  16. #include "qd3d_support.h"
  17. #include "mymenus.h"
  18. #include "myevents.h"
  19. #include "misc.h"
  20. #include "3dmf.h"
  21. #include "process.h"
  22.  
  23. extern    QD3DSetupOutputType        gModelViewInfo;
  24.  
  25. /****************************/
  26. /*    PROTOTYPES            */
  27. /****************************/
  28.  
  29. static    void ToolBoxInit(void);
  30.  
  31.  
  32. /*****************/
  33. /* TOOLBOX INIT  */
  34. /*****************/
  35.  
  36. static void ToolBoxInit(void)
  37. {
  38. TQ3Status    myStatus;
  39. long response;
  40.  
  41.      MaxApplZone();
  42.     InitGraf(&qd.thePort);
  43.     FlushEvents ( everyEvent, REMOVE_ALL_EVENTS);
  44.     InitFonts();
  45.     InitWindows();
  46.     InitDialogs(nil);
  47.     InitCursor();
  48.     InitMenus();
  49.     TEInit();
  50.     
  51.             /* SEE IF QD3D AVAILABLE */
  52.     
  53.     if((void *)Q3Initialize == (void *)kUnresolvedCFragSymbolAddress)
  54.         DoFatalAlert("\pQuickDraw 3D version 1.6 or better is required to run this application!");
  55.  
  56.     myStatus = Q3Initialize();
  57.     if ( myStatus == kQ3Failure )
  58.         DoFatalAlert("\pQ3Initialize returned failure.");    
  59.         
  60.     Gestalt(gestaltQD3D, &response);
  61.     if (response & (1<<gestaltQD3DPresent))
  62.     {    
  63.         Gestalt(gestaltQD3DVersion,&response);
  64.         if (response < 0x10500)                        // must be using 1.6 or better
  65.         {
  66. err:        
  67.             DoFatalAlert("\pQuickDraw 3D version 1.6 or better is required to run this application!");
  68.         }
  69.     }
  70.     else
  71.         goto err;
  72. }
  73.  
  74.  
  75.  
  76. /*****************/
  77. /* TOOLBOX EXIT  */
  78. /*****************/
  79.  
  80. static void ToolBoxExit(void)
  81. {
  82. TQ3Status    myStatus;
  83.  
  84.     myStatus = Q3Exit();
  85.     if ( myStatus == kQ3Failure )
  86.         DoFatalAlert("\pQ3Exit returned failure.");                
  87. }
  88.  
  89.  
  90. /************************************************************/
  91. /******************** PROGRAM MAIN ENTRY  *******************/
  92. /************************************************************/
  93.  
  94.  
  95. void main(void)
  96. {
  97.  
  98.     ToolBoxInit();                  
  99.     InitMenuBar();
  100.     InitTest();
  101.  
  102.     while (true)
  103.         HandleEvents();
  104.  
  105.     ToolBoxExit();
  106. }
  107.  
  108.  
  109.  
  110.