Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Source/WRay_Main.c
/* |
* WRay_Main.c |
* |
* QuickDraw 3D 1.6 Sample |
* Robert Dierkes |
* |
* 07/28/98 RDD Created. |
*/ |
/*------------------*/ |
/* Include Files */ |
/*------------------*/ |
#include "QD3D.h" |
#if defined(OS_MACINTOSH) && OS_MACINTOSH |
#include <Fonts.h> |
#endif |
#include "WRay_Error.h" |
#include "WRay_Events.h" |
#include "WRay_Message.h" |
#include "WRay_Menu.h" |
#include "WRay_Pick.h" |
#include "WRay_Scene.h" |
#include "WRay_System.h" |
/*----------------------*/ |
/* Global Declarations */ |
/*----------------------*/ |
TQ3Boolean gTimeToQuit; |
TDocument gDocument; |
/*----------------------*/ |
/* Local Prototypes */ |
/*----------------------*/ |
static |
TQ3Boolean Main_Initialize( |
void); |
static |
TQ3Boolean Main_Exit( |
void); |
static |
void Main_Initialize_Toolbox ( |
void); |
void main( |
void) |
{ |
if (Main_Initialize()) { |
Events_Process(); |
Main_Exit(); |
} |
} |
/* |
* Main_Initialize |
* |
* Globals: |
* gDocument |
*/ |
static |
TQ3Boolean Main_Initialize( |
void) |
{ |
gTimeToQuit = kQ3False; |
Main_Initialize_Toolbox(); |
if (Events_Initialize() == false) |
return kQ3False; |
if (QuickDraw3D_Initialize() == kQ3False) |
return kQ3False; |
Message_Register(); |
if (Menu_Initialize() == kQ3False) |
return kQ3False; |
if (Pick_Initialize() == kQ3False) |
return kQ3False; |
if (Document_Initialize(&gDocument) == kQ3False) |
return kQ3False; |
/* |
* Menu_InitializeItems() must follow: |
* Document_Initialize() |
*/ |
if (Menu_InitializeItems(&gDocument) == kQ3False) |
return kQ3False; |
return kQ3True; |
} |
/* |
* Main_Exit |
* |
* Globals: |
* gDocument |
* gTimeToQuit |
*/ |
static |
TQ3Boolean Main_Exit( |
void) |
{ |
if (gTimeToQuit) { |
Document_Exit(&gDocument); |
(void) Pick_Exit(); |
(void) QuickDraw3D_Exit(); |
gTimeToQuit = kQ3False; |
} |
return kQ3True; |
} |
/* |
* Main_Initialize_Toolbox |
* |
*/ |
static |
void Main_Initialize_Toolbox( |
void) |
{ |
MaxApplZone(); |
MoreMasters(); |
MoreMasters(); |
MoreMasters(); |
InitGraf(&qd.thePort); |
InitFonts(); |
InitWindows(); |
InitCursor(); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14