home *** CD-ROM | disk | FTP | other *** search
- /****************************/
- /* MAIN.C */
- /****************************/
-
-
- /****************************/
- /* EXTERNALS */
- /****************************/
-
- #include <qd3d.h>
-
- /****************************/
- /* PROTOTYPES */
- /****************************/
-
- extern void InitMyScene(void);
- extern void DrawMyObjects(void);
-
- void main(void);
- void DoFatalAlert(Str255 s);
- void ToolBoxInit(void);
-
-
- /****************************/
- /* CONSTANTS */
- /****************************/
-
- #define ERROR_ALERT_ID 401
-
-
- /****************************/
- /* VARIABLES */
- /****************************/
-
-
-
- /*********************** DO FATAL ALERT *******************/
-
- void DoFatalAlert(Str255 s)
- {
- ParamText(s,nil,nil,nil);
- NoteAlert(ERROR_ALERT_ID,nil);
- Q3Exit(); // unload qd3d
- ExitToShell();
- }
-
-
- /************ TOOLBOX INIT ************/
- //
- // Get the Mac up & running, then init QuickDraw 3D
- //
-
- void ToolBoxInit(void)
- {
- TQ3Status myStatus;
-
- MaxApplZone();
- InitGraf(&qd.thePort);
- FlushEvents ( everyEvent, 0);
- InitFonts();
- InitWindows();
- InitDialogs(nil);
- InitCursor();
- InitMenus();
- TEInit();
-
- /* Initialize Escher */
-
- myStatus = Q3Initialize();
- if ( myStatus == kQ3Failure )
- DebugStr("\pQ3Initialize returned failure!");
- }
-
-
-
- /************************************************************/
- /******************** PROGRAM MAIN ENTRY *******************/
- /************************************************************/
-
-
- void main(void)
- {
- ToolBoxInit();
-
- InitMyScene(); // init the scene
- DrawMyObjects(); // draw the scene
-
- while(!Button()); // wait for mouse click
-
- Q3Exit(); // unload qd3d
- FlushEvents ( everyEvent, 0);
- ExitToShell();
- }
-
-
-
-