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/Main.c
/****************************/ |
/* CULL TEST */ |
/* By Brian Greenstone */ |
/****************************/ |
/****************************/ |
/* EXTERNALS */ |
/****************************/ |
#include <Fonts.h> |
#include <Resources.h> |
#include <Rave.h> |
#include "myglobals.h" |
#include "qd3d_support.h" |
#include "objects.h" |
#include "mymenus.h" |
#include "mywindows.h" |
#include "myevents.h" |
#include "main.h" |
#include "misc.h" |
#include "3dmf.h" |
#include "process.h" |
extern QD3DSetupOutputType gModelViewInfo; |
/****************************/ |
/* PROTOTYPES */ |
/****************************/ |
static void ToolBoxInit(void); |
/****************************/ |
/* CONSTANTS */ |
/****************************/ |
/****************************/ |
/* VARIABLES */ |
/****************************/ |
short gMainAppRezFile; |
/*****************/ |
/* TOOLBOX INIT */ |
/*****************/ |
static void ToolBoxInit(void) |
{ |
TQ3Status myStatus; |
MaxApplZone(); |
InitGraf(&qd.thePort); |
FlushEvents ( everyEvent, REMOVE_ALL_EVENTS); |
InitFonts(); |
InitWindows(); |
InitDialogs(NIL_POINTER); |
InitCursor(); |
InitMenus(); |
TEInit(); |
gMainAppRezFile = CurResFile(); |
/* SEE IF QD3D AVAILABLE */ |
if((void *)Q3Initialize == (void *)kUnresolvedCFragSymbolAddress) |
DoFatalAlert("\pQuickDraw 3D version 1.5 or better is required to run this application!"); |
myStatus = Q3Initialize(); |
if ( myStatus == kQ3Failure ) |
DoFatalAlert("\pQ3Initialize returned failure."); |
} |
/*****************/ |
/* TOOLBOX EXIT */ |
/*****************/ |
static void ToolBoxExit(void) |
{ |
TQ3Status myStatus; |
myStatus = Q3Exit(); |
if ( myStatus == kQ3Failure ) |
DoFatalAlert("\pQ3Exit returned failure."); |
} |
/************************************************************/ |
/******************** PROGRAM MAIN ENTRY *******************/ |
/************************************************************/ |
void main(void) |
{ |
ToolBoxInit(); |
InitMenuBar(); |
/* INIT STUFF */ |
InitObjectManager(); |
InitTest(); // create QD3D window environment |
/* PROGRAM MAIN LOOP */ |
while (true) |
HandleEvents(); |
ToolBoxExit(); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14