[info-performer] sequence of pfFunction in Perfly - free gift

Date view Thread view Subject view Author view

From: Dan Johnston (dan.johnston++at++nrc.ca)
Date: 06/10/2004 06:10:05


Here is a free gift to all pfDevelopers.

I was/am trying to figure out why perfly does a
better job of setting the visual attributes than my
applications do - on various OS and hardware.

I decided to map out the sequence of calls used
in standard (C version) of perfly. Since it may
be useful to others, I have attached it below.

My emphasis was on attributes and visuals, but
the sequence is reasonably complete for all
basic operations. The question marks on the
last line are because I have not worked out
what this code does yet. (But I will!)

I hope it is of some use to you.

BTW: I cannot use exactly what perfly does
because I want to emphasize the use of
stereo visuals if possible on all platforms, and
default to mono visuals if not, allow user
defined overrides, and finally default to
the perfly-like defaults only if all else fails.

PS: If the sequence is unreadable because the
indenting gets eaten by the mail programs, then
try the uuencoded version (also attached) or
I can put a copy on our FTP site.

Dan Johnston

________________________________________

Sequence of performer calls in SGI's 'perfly' application

main function
    pfInit <<<
    init shared memory
        get display screen for querys (if not Win32)
        get screen max size (or fix max size on Win32)
        get number of screens (or set = 1 on Win32)
        set window size
        set channel order (from command line)
        init shared memory data
        set data search path
        init loader DSOs
        get number of hyperpipes and map channels to hyperpipes
    pfuInit <<<
    init config
        init multiprocessing mode (pfMultiprocess)
        set number of pipes to use (pfMultipipe)
        enable hyperpipe if used
        set intersection callback
        get available number of CPUs
        local init config
           start the calligraphic boards if any
           load some textures
    setup default process manager (if set in command line opts)
    pfConfig <<<
    tell ProcessManager to configure the system (if flag set)
    pfiInit <<<
    init scene
        create scene graph
        set bounding sphere
        write out scene if requested
        init view
    init pipe
        if hyperpipe init screens and assign screen to hyperpipe
        for all pipes
            get new pipe window for pipe i
            set pipe window name
            set pipe window origin/size
            set config function (by name) (pfPWinConfigFunc)
            set specific visual if defined in cmd line
(pfPWinFBConfigId)
            pfConfigPWin <<< - config happens at pfFrame
                if shader set std shader attrs (pfPWinFBConfigAttrs)
                else select visual use std attrs as limits
(pfuChooseFBConfig)
                if get visual then (if not win32) config PW
(pfPWinFBConfig)
                open GLX window (pfuGLXWinopen)
                init GFX
                    config pipe window
                        default materal
                        default lighting
                        prebind std textures
                    init pipe
                        welcome message
            set callback for each stage
            configure stage for CULL, DRAW, LPOINT
    pfFrame <<<
    init GUI
        init GUI (pfuInitGUI)
        enable GUI (pfuEnableGUI)
    init channel
        assign channels to all pipes - pfNewChan( get pipe i)
        channel bin order (pfChanBinOrder)
        set master channel
        channel share viewport, near/far, FOV
        set master field of view (FOV)
        set view offsets if supplied
        callback routines for each channel
        attach scene to master
        set earth sky model
        set near/far
        set aspect ratio
        set initial viewpoint
        local channel init
            set channel DVR size
            cliptexture center
        set stats structure
        init GUI
            set GUI viewport
            init panel (create widgets)
            update panel
            enable panel
            update GUI (turn on or off from common memory flag)
        init xformer model
    init input handeling (pfuInitMultiChanInput or pfuInitInput)
    lock down CPUs (if you can)
    set the desired frame rate (default is 72 Hz)
    set the MP synchronization phase (pfPhase) (default is free run)

    main Performer loop
        pfSync <<<
        pre frame stuff
             get mouse position and buttons
             local pre frame
                 video resize on all channels
             if real time input, update view
     pfFrame <<<
     post frame stuff
            pfuGetEvents <<<
            if not real time view, update view
                 reset view position if requested
                 else set viewpoint via xformer
                 update box representing CULL volume
           update the sim state
                 process keyboard input
                 adjust load management filter
                 update GUI
                 change CULLmode and LOD scale if required
                 lighting/ time of day
                 stats
                 update environment
                      earth sky
                 update window
                      select proper visual in the window to render to
(??)
  _______________________________________

uuencoded version (should preserve tabs, spacing)

begin 644 perflyseq
M4V5Q=65N8V4++at++;V8++at++<&5R9F]R;65R(&-A;&QS(&EN(%-'22=S("=P97)F;'DG
M(&%P<&QI8V%T:6]N"++at++IM86EN(&9U;F-T:6]N"B`++at++("!P9DEN:70++at++/#P\"B`++at++
M("!I;FET('-H87)E9"!M96UO<GD*("`++at++("`++at++("!G970++at++9&ES<&QA>2!S8W)E
M96X++at++9F]R('%U97)Y<R`H:68++at++;F]T(%=I;C,R*0H)("`++at++(&=E="!S8W)E96X++at++
M;6%X('-I>F4++at++*&]R(&9I>"!M87++at++++at++<VEZ92!O;B!7:6XS,BD*"2`++at++("!G970++at++
M;G5M8F5R(&]F('-C<F5E;G,++at++*&]R('-E="`](#$++at++;VX++at++5VEN,S(I"++at++D++at++("`++at++
M<V5T('=I;F1O=R!S:7IE"++at++D++at++("`++at++<V5T(&-H86YN96P++at++;W)D97(++at++*&9R;VT++at++
M8V]M;6%N9"!L:6YE*0H)("`++at++(&EN:70++at++<VAA<F5D(&UE;6]R>2!D871A"++at++D++at++
M("`++at++<V5T(&1A=&$++at++<V5A<F-H('!A=&++at++*"2`++at++("!I;FET(&QO861E<B!$4T]S
M"++at++D++at++("`++at++9V5T(&YU;6)E<B!O9B!H>7!E<G!I<&5S(&%N9"!M87`++at++8VAA;FYE
M;',++at++=&\++at++:'EP97)P:7!E<PH++at++("`++at++<&9U26YI="`\/#P*("`++at++(&EN:70++at++8V]N
M9FEG"B`++at++("`++at++("`++at++:6YI="!M=6QT:7!R;V-E<W-I;F<++at++;6]D92`H<&9-=6QT
M:7!R;V-E<W,I"++at++D++at++("`++at++<V5T(&YU;6)E<B!O9B!P:7!E<R!T;R!U<V4++at++*'!F
M375L=&EP:7!E*0H)("`++at++(&5N86)L92!H>7!E<G!I<&4++at++:68++at++=7-E9`H)("`++at++
M('-E="!I;G1E<G-E8W1I;VX++at++8V%L;&)A8VL*"2`++at++("!G970++at++879A:6QA8FQE
M(&YU;6)E<B!O9B!#4%5S"++at++D++at++("`++at++;&]C86P++at++:6YI="!C;VYF:6<*"2`++at++("`++at++
M("`++at++<W1A<G0++at++=&AE(&-A;&QI9W)A<&AI8R!B;V%R9',++at++:68++at++86YY"++at++D++at++("`++at++
M("`++at++(&QO860++at++<V]M92!T97AT=7)E<PH++at++("`++at++<V5T=7`++at++9&5F875L="!P<F]C
M97-S(&UA;F%G97(++at++*&EF('-E="!I;B!C;VUM86YD(&QI;F4++at++;W!T<RD*("`++at++
M('!F0V]N9FEG(#P\/`H++at++("`++at++=&5L;"!0<F]C97-S36%N86=E<B!T;R!C;VYF
M:6=U<F4++at++=&AE('-Y<W1E;2`H:68++at++9FQA9R!S970I"B`++at++("!P9FE);FET(#P\
M/`H++at++("`++at++:6YI="!S8V5N90H++at++("`++at++("`++at++(&-R96%T92!S8V5N92!G<F%P:`H)
M("`++at++('-E="!B;W5N9&EN9R!S<&AE<F4*"2`++at++("!W<FET92!O=70++at++<V-E;F4++at++
M:68++at++<F5Q=65S=&5D"++at++D++at++("`++at++:6YI="!V:65W"B`++at++("!I;FET('!I<&4*("`++at++
M("`++at++("!I9B!H>7!E<G!I<&4++at++:6YI="!S8W)E96YS(&%N9"!A<W-I9VX++at++<V-R
M965N('1O(&AY<&5R<&EP90H)("`++at++(&9O<B!A;&P++at++<&EP97,*"2`++at++("`++at++("`++at++
M9V5T(&YE=R!P:7!E('=I;F1O=R!F;W(++at++<&EP92!I"++at++D++at++("`++at++("`++at++('-E="!P
M:7!E('=I;F1O=R!N86UE"++at++D++at++("`++at++("`++at++('-E="!P:7!E('=I;F1O=R!O<FEG
M:6XO<VEZ90H)("`++at++("`++at++("!S970++at++8V]N9FEG(&9U;F-T:6]N("AB>2!N86UE
M*2`H<&905VEN0V]N9FEG1G5N8RD*"2`++at++("`++at++("`++at++<V5T('-P96-I9FEC('9I
M<W5A;"!I9B!D969I;F5D(&EN(&-M9"!L:6YE("AP9E!7:6Y&0D-O;F9I9TED
M*0H)("`++at++("`++at++("!P9D-O;F9I9U!7:6X++at++/#P\("T++at++8V]N9FEG(&AA<'!E;G,++at++
M870++at++<&9&<F%M90H)("`++at++("`++at++("`++at++("`++at++:68++at++<VAA9&5R('-E="!S=&0++at++<VAA
M9&5R(&%T=')S("AP9E!7:6Y&0D-O;F9I9T%T=')S*0H)("`++at++("`++at++("`++at++("`++at++
M96QS92!S96QE8W0++at++=FES=6%L('5S92!S=&0++at++871T<G,++at++87,++at++;&EM:71S("AP
M9G5#:&]O<V5&0D-O;F9I9RD*"0D++at++("`++at++("`++at++(&EF(&=E="!V:7-U86P++at++=&AE
M;B`H:68++at++;F]T('=I;C,R*2!C;VYF:6<++at++4%<++at++*'!F4%=I;D9"0V]N9FEG*0H)
M"2`++at++("`++at++("`++at++;W!E;B!'3%++at++++at++=VEN9&]W("AP9G5'3%A7:6YO<&5N*0H)"2`++at++
M("`++at++("`++at++:6YI="!'1E++at++*"0D++at++("`++at++("`++at++("`++at++("!C;VYF:6<++at++<&EP92!W:6YD
M;W<*"0D++at++("`++at++("`++at++("`++at++("`++at++("`++at++9&5F875L="!M871E<F%L"++at++D)"2`++at++("`++at++
M("`++at++("`++at++(&1E9F%U;'0++at++;&EG:'1I;F<*"0D)("`++at++("`++at++("`++at++("`++at++<')E8FEN
M9"!S=&0++at++=&5X='5R97,*"0D++at++("`++at++("`++at++("`++at++("!I;FET('!I<&4*"0D)("`++at++
M("`++at++("`++at++("`++at++=V5L8V]M92!M97-S86=E"++at++D++at++("`++at++<V5T(&-A;&QB86-K(&9O
M<B!E86-H('-T86=E"++at++D++at++("`++at++8V]N9FEG=7)E('-T86=E(&9O<B!#54Q,+"!$
M4D%7+"!,4$])3E0*("`++at++('!F1G)A;64++at++/#P\"B`++at++("!I;FET($=520H++at++("`++at++
M("`++at++(&EN:70++at++1U5)("AP9G5);FET1U5)*0H++at++("`++at++("`++at++(&5N86)L92!'54D++at++
M*'!F=45N86)L94=522D*("`++at++(&EN:70++at++8VAA;FYE;`H++at++("`++at++("`++at++(&%S<VEG
M;B!C:&%N;F5L<R!T;R!A;&P++at++<&EP97,++at+++2!P9DYE=T-H86XH(&=E="!P:7!E
M(&DI"++at++D++at++("`++at++8VAA;FYE;"!B:6X++at++;W)D97(++at++*'!F0VAA;D)I;D]R9&5R*0H)
M("`++at++('-E="!M87-T97(++at++8VAA;FYE;`H)("`++at++(&-H86YN96P++at++<VAA<F4++at++=FEE
M=W!O<G0L(&YE87(O9F%R+"!&3U8*"2`++at++("!S970++at++;6%S=&5R(&9I96QD(&]F
M('9I97<++at++*$9/5BD*"2`++at++("!S970++at++=FEE=R!O9F9S971S(&EF('-U<'!L:65D
M"++at++D++at++("`++at++8V%L;&)A8VL++at++<F]U=&EN97,++at++9F]R(&5A8V++at++++at++8VAA;FYE;`H)("`++at++
M(&%T=&%C:"!S8V5N92!T;R!M87-T97(*"2`++at++("!S970++at++96%R=&++at++++at++<VMY(&UO
M9&5L"++at++D++at++("`++at++<V5T(&YE87(O9F%R"++at++D++at++("`++at++<V5T(&%S<&5C="!R871I;PH)
M("`++at++('-E="!I;FET:6%L('9I97=P;VEN=`H)("`++at++(&QO8V%L(&-H86YN96P++at++
M:6YI=`H)("`++at++("`++at++("!S970++at++8VAA;FYE;"!D=G(++at++<VEZ90H)("`++at++("`++at++("!C
M;&EP=&5X='5R92!C96YT97(*"2`++at++("!S970++at++<W1A=',++at++<W1R=6-T=7)E(`H)
M("`++at++(&EN:70++at++1U5)"++at++D++at++("`++at++("`++at++('-E="!'54D++at++=FEE=W!O<G0*"2`++at++("`++at++
M("`++at++:6YI="!P86YE;"`H8W)E871E('=I9&=E=',I"++at++D++at++("`++at++("`++at++('5P9&%T
M92!P86YE;`H)("`++at++("`++at++("!E;F%B;&4++at++<&%N96P*"2`++at++("`++at++("`++at++=7!D871E
M($=522`H='5R;B!O;B!O<B!O9F8++at++9G)O;2!C;VUM;VX++at++;65M;W)Y(&9L86<I
M"++at++D++at++("`++at++:6YI="!X9F]R;65R(&UO9&5L"B`++at++("!I;FET(&EN<'5T(&AA;F1E
M;&EN9R`H<&9U26YI=$UU;'1I0VAA;DEN<'5T(&]R('!F=4EN:71);G!U="D*
M("`++at++(&QO8VL++at++9&]W;B!#4%5S("AI9B!Y;W4++at++8V%N*0H++at++("`++at++<V5T('1H92!D
M97-I<F5D(&9R86UE(')A=&4++at++*&1E9F%U;'0++at++:7,++at++-S(++at++2'HI"B`++at++("!S970++at++
M=&AE($U0('-Y;F-H<F]N:7IA=&EO;B!P:&%S92`H<&90:&%S92D++at++*&1E9F%U
M;'0++at++:7,++at++9G)E92!R=6XI"++at++H++at++("`++at++;6%I;B!097)F;W)M97(++at++;&]O<`H++at++("`++at++
M("`++at++('!F4WEN8R`\/#P*"2`++at++("!P<F4++at++9G)A;64++at++<W1U9F8*"2`++at++("`++at++("`++at++
M9V5T(&UO=7-E('!O<VET:6]N(&%N9"!B=71T;VYS"++at++D++at++("`++at++("`++at++(&QO8V%L
M('!R92!F<F%M90H)("`++at++("`++at++("`++at++("`++at++=FED96\++at++<F5S:7IE(&]N(&%L;"!C
M:&%N;F5L<PH)("`++at++("`++at++("!I9B!R96%L('1I;64++at++:6YP=70L('5P9&%T92!V
M:65W"++at++D++at++("`++at++<&9&<F%M92`\/#P*"2`++at++("!P;W-T(&9R86UE('-T=69F"++at++D++at++
M("`++at++("`++at++('!F=4=E=$5V96YT<R`\/#P*"2`++at++("`++at++("`++at++:68++at++;F]T(')E86P++at++
M=&EM92!V:65W+"!U<&1A=&4++at++=FEE=R`*"2`++at++("`++at++("`++at++("`++at++(')E<V5T('9I
M97<++at++<&]S:71I;VX++at++:68++at++<F5Q=65S=&5D"++at++D)("`++at++("`++at++("!E;'-E('-E="!V
M:65W<&]I;G0++at++=FEA('AF;W)M97(*"0D++at++("`++at++("`++at++('5P9&%T92!B;W++at++++at++<F5P
M<F5S96YT:6YG($-53$P++at++=F]L=6UE"++at++D++at++("`++at++("`++at++('5P9&%T92!T:&4++at++<VEM
M('-T871E"++at++D++at++("`++at++("`++at++("`++at++("!P<F]C97-S(&ME>6)O87)D(&EN<'5T"++at++D)
M("`++at++("`++at++("!A9&IU<W0++at++;&]A9"!M86YA9V5M96YT(&9I;'1E<++at++H)"2`++at++("`++at++
M("`++at++=7!D871E($=520H)"2`++at++("`++at++("`++at++8VAA;F=E($-53$QM;V1E(&%N9"!,
M3T0++at++<V-A;&4++at++:68++at++<F5Q=6ER960*"0D++at++("`++at++("`++at++(&QI9VAT:6YG+R!T:6UE
M(&]F(&1A>0H)"2`++at++("`++at++("`++at++<W1A=',*"0D++at++("`++at++("`++at++('5P9&%T92!E;G9I
M<F]N;65N=`H)"2`++at++("`++at++("`++at++("`++at++(&5A<G1H('-K>0H)"2`++at++("`++at++("`++at++=7!D
M871E('=I;F1O=PH)"2`++at++("`++at++("`++at++("`++at++('-E;&5C="!P<F]P97(++at++=FES=6%L
D(&EN('1H92!W:6YD;W<++at++=&\++at++<F5N9&5R('1O("++at++_/RD*"0D*
`
end
 _______________________________________

Dan.Johnston++at++nrc.gc.ca
National Research Council of Canada, London, ON
Integrated Manufacturing Technologies Institute
Tel: (519) 430-7081 Fax: (519) 430-7090
http://www.nrc.gc.ca/imti
These opinions are my own! Not those of NRC.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Jun 10 2004 - 06:11:38 PDT