1. pfInit() This must be the first call in a libpf application. It initialized IRIS Performer, creates shared memory, and prepares everything to be used. 2. InitSharedMem(argc, argv) This function is in generic.C. It a. allocates memory for the arena and screen. This must be done before pfConfig(), so the forked processes have the same pointers. It also finds the size of the screen, orders channels, etc. b. initViewState() i. in perfly.c ii. sets up defaults for the struct SharedViewState c. tells where to look for data files (.flt, etc) d. converts all necessary files with pfdInitConvertor(char[]) e. sets the ViewState->guiFormat f. finds number of channels and pipes 3. InitConfig() This function is in generic.C and a. pfMultipipe(int) i. sets multiprocessing mode based on number of processors ii. must be done between pfInit and pfConfig iii. different parameters allow the cull, draw, and app processes to happen simultaneously, or at specified times. b. pfMultipipe(int) sets number of pipes c. pfIsectFunc(func) sets intersection callback d. checks for restricted CPUs 4. pfConfig() forks extra processes if configured for multiprocessing 5. pfuInitUtil() and pfiInit() initialize the utility libraries 6. InitScene() is in generic.C and a. gets the scene from the command line b. keeps track of elapsed time c. initializes the scene (collision, textures, environment) d. converts the scene of loaded e. initView(pfScene *) is in perfly.C i. gets the boundaries of the scene ii. sets the initial view iii. sets the near and far viewing planes 7. InitPipe() is in generic.C and initializes the pipeline(s). a. initializes each pipe with a pfPipeWindow, screen, name, and configuration b. pfStageConfigFunc(pfPipe, stageMask, configFunc) configures processes not associated with pfPipes (e.g. database processes, intersection, cull) 8. pfFrame() starts off first frame of cull and draw processes in parallel with app 9. IniGUI() This is in generic.C and initializes the GUI first so that it is the first channel a. initializes GUI to master channel and pipe b. enables GUI and the ViewState member gui 10. InitChannel() This is in generic.C a. distributes channels across pipes if multipipe, else creates channels on one pipe b. disables sorting for OPAQUE bin in CULLoDRAW mode c. orders channels d. makes master channel the source for keyboard and mouse input e. sets the viewports, if multipipe f. attaches channels to master channel to for a group g. sets field of view h. sets callback routines i. attaches the ViewState members to the master channel j. matches the vertical field of view to the window aspect ratio k. calls the makeSimple(fov) function creates a frustum on an axis and sets the angle l. sets up the stats m. initializes the GUI to the master channel 11. pfuInitInput(pfPipeWindow, input) initializes the input handling(X or GL) for mouse and event inputs 12. set up processor locking for app process 13. pfFrameRate(rate) sets desired frame rate 14. pfPhase(phase) sets the multiprocessing sync phase 15. Application main loop a. PreFrame() is in generic.C and updates mouse buttons and view b. pfFrame() triggers cull and draw processes for this frame c. PostFrame() in generic.C i. gets events ii. updateSim(pfChan) - processes keyboard input - adjusts load management filter (checks for stress) - checks if needs to update channels and GUI - resets cullMode and level of detail - updates ViewState members like timeOfDay, stats, env, etc) 16. cleans up memory and exits
Return to the top.