Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Not the usual speed issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • David Roberts
    replied
    Ok.

    Leave a comment:


  • Jim Fritts
    replied
    These sleeps do not matter that is why I designed them that way. The main app is just waiting (Twiddling its thumbs). The meat and potatoes is what is going on inside the threads. I could replace one of the SLEEP 10s with a DIALOG DOEVENTS 10 so that Windows knows that the app is still running and not foundered. That may be pointless since the main app never displays itself. If you write bad test procedures and produce a runaway condition or you write test routines that take days to complete then sorry about your luck. You will have to deal with that accordingly.

    To be clear I am very happy with the design.


    Code:
        SLEEP 2    '<= good candidate for SLEEP 16
    
        IF giIterate < 1000 THEN
            ? "Sorry, the requested tests could not be run. giIterate is too low for an adequate sample."
            GOTO CloseDown
        END IF
    
        FOR XC = 1 TO 10  'do 10 runs
    
            LOCAL hThread1 AS DWORD
            THREAD CREATE ProcessTest1(1) TO hThread1
            THREAD CLOSE hThread1 TO hThread1
    
            LOCAL hThread2 AS DWORD
            THREAD CREATE ProcessTest2(1) TO hThread2
            THREAD CLOSE hThread2 TO hThread2
    
            SLEEP 10    '<= good candidate for a DIALOG DOEVENTS 10
    
            giSync = 1
    
            DO WHILE gAction1 = 1 OR gAction2 = 1
                SLEEP 10
            LOOP
            g_Result = SetPriorityClass(GetCurrentProcess(), %NORMAL_PRIORITY_CLASS)
            AVG(XC, 1) = Test1
            AVG(XC, 2) = Test2
    
        NEXT
    Yes, David I read your post here about using a SLEEP 16 following timeBeginPeriod. The SLEEP 2 could be replaced with SLEEP 16. Not a problem.
    Last edited by Jim Fritts; 30 Jun 2020, 05:42 PM.

    Leave a comment:


  • David Roberts
    replied
    Jim, just to be clear, you are saying you are happy with
    Code:
     14.8398
     14.302
     14.1093
     14.1342
     14.7293
     14.1307
     14.9193
     14.189
     14.0317
     14.7053
    
     14.9717
     14.4695
     14.1275
     14.1456
     14.1796
     14.1317
     14.1518
     14.6055
     14.1571
     14.2258
    where the first 10 are 'Sleep 2' and the second 10 are 'Sleep 10' with one run and a resolution of 15.625ms as opposed to
    Code:
     2.9684
     2.4481
     2.2715
     2.7352
     2.0297
     2.4752
     2.1266
     2.4811
     2.5091
     2.5954
    
     10.4209
     10.0936
     10.3926
     10.9569
     10.4703
     10.8294
     10.0873
     10.1216
     10.9399
     10.2441
    with a resolution of 1ms.

    For me I would have used 'Sleep 5' - I wouldn't have chosen 'Sleep 2' and 'Sleep 10' which would look like I was being specific.

    Leave a comment:


  • Jim Fritts
    replied
    David,
    As I have indicated many times the SLEEPs have no bearing on the tests.

    Extraction from PB_Benchmark:
    SLEEP 2 and SLEEP 10 are arbitrary values placed in the main part
    of the app and are used as transitonary to insure this:
    1) The process of assigning values to strings does not interfere
    with the thread activity that follows.
    2) Waiting for the threads to come alive so that the threads can
    be synchronized and begin processing at approximately the same
    time.
    3) Waiting on both threads to finish before processing the thread data. <= additional info

    And yes the test routines are working at the highest possible speed without jumping head long into ASM.

    Leave a comment:


  • David Roberts
    replied
    'Sleep 2' and 'Sleep 10' now have a resolution of 1ms - previously they had a resolution of 15.625ms - a bonus!

    Leave a comment:


  • Jim Fritts
    replied
    PB_Benchmark_8
    Right to your door delivery as promised.

    Leave a comment:


  • David Roberts
    replied
    Originally posted by Jim
    See David's code at work in PB_Benchmark_8 coming soon.
    Vapourware at PowerBASIC's peer support community. Tsk, tsk!

    Leave a comment:


  • Jim Fritts
    replied
    See David's code at work in PB_Benchmark_8 coming soon.

    Leave a comment:


  • Jim Fritts
    replied
    Alrighty then. I'll give it a try. Thanks

    Results so far for no Silence:
    40 fps no other apps up.
    39.94 fps with Edge (Chromium) up and active covering app.
    39.13 fps no REALTIME.
    39.94 fps with REALTIME added back.

    Confirmed USB interface acceleration on another app. Looks like I will be dropping the use of Silence.MP3. Thank you David!

    Leave a comment:


  • David Roberts
    replied
    Originally posted by Jim
    David, I have not used your suggested method.
    Oops - my bad. I added it to one of your source code and thought that you had put it there.

    In which case comment out the use of Silence.mp3 and then add the three lines to the head of PBMain as mentioned in post #44.

    I am confident that you will be adding those lines to PB_Benchmark and not use Silence.mp3.

    Leave a comment:


  • Jim Fritts
    replied
    David,
    Yes, REALTIME is unneeded. What you are seeing are the artifacts of implementing changes to the original app to see their overall effect.

    These were the sequential changes:
    1) Change timer to TIX (no change)
    2) Add REALTIME priority (minimal change)
    3) Put display routine in a thread (minimal change)
    4) Add Silence.MP3 (significant change) [1.18 times faster on my system and 1.179 times faster on your system]

    NOTE:
    Post #45 has changed. Slow typist remember.

    Leave a comment:


  • David Roberts
    replied
    Originally posted by Jim
    Please try running the code without Silence.
    I did. The point that I was making was Silence is not needed - all we have to do is 'up the ante' on the timer interval. Using Silence is a pointless exercise when we can get the same result by using a 1000Hz timer rather than the System Clock.

    Whilst I am 'at it' using REALTIME_PRIORITY_CLASS for over two minutes, or even HIGH_PRIORITY_CLASS for over two minutes, is not a good idea. Both are for time-critical events and not for speeding up applications. If a function is not fast enough then we need to look at its design. In fact, neither of them should give us much as used. I removed REALTIME_PRIORITY_CLASS from your code and its removal was not noticed with regard fps. I am not being a 'party pooper ' - I don't see the point of doing something if it doesn't actually do anything.

    Leave a comment:


  • Jim Fritts
    replied
    David,
    I take it from your other recent posts you are still using WINX 1909. Not trying to prove anything. I'm just interested in the concept of acceleration and want to share what has served me well for years.

    As I expected your data and my data show that playing Silence increases fps. Thank you for your added validation.

    NOTE:
    The Edge (Chromium) Browser data was used to show a minimal fps drop even though it was actively employed and covering Rodney's app. That indicates that my method is working correctly.

    at the head of PBMain as you have done with other applications in the past.
    David, I have not used your suggested method.

    Getting the Edge browser involved is not a good idea because it oscillates between 15.625ms and 1ms when 'idling'. When Firefox opens with no content it oscillates between 15.625ms and 6.5ms. This is not how these two browsers used to behave; it is quite a while since I last tested them.
    See NOTE above. An app playing Silence is minimally affected by time oscillations.

    Likely I will apply my method to the next version of PB_Benchmark.

    Leave a comment:


  • David Roberts
    replied
    Jim, I'm not sure what you are trying to prove.

    I ran your code in post #42 three times, as is, and got fps at 58.83, 58.89 and 59.17 => average 58.96

    I repeated with Silence.mp3 running and got 69.05, 70.13 and 69.42 => average 69.53.

    I repeated with my setting the timer interval to 1ms, via a separate application, and got 70.83, 71.15 and 71.25 => average 71.07.

    There is a marked difference between 'as is' and the other timings.

    Since running Silence.mp3 changes the timer interval to 1ms I expected the figures to be pretty much the same as my setting the timer interval to 1ms. There was a difference but only by 2%.

    Getting the Edge browser involved is not a good idea because it oscillates between 15.625ms and 1ms when 'idling'. When Firefox opens with no content it oscillates between 15.625ms and 6.5ms. This is not how these two browsers used to behave; it is quite a while since I last tested them.

    So, forget Silence.mp3 and just add:
    Code:
    Local Time As TIMECAPS
    TimeGetDevCaps( Time, SizeOf(Time) )
    timeBeginPeriod(Time.wPeriodMin)
    at the head of PBMain as you have done with other applications in the past.

    Notes: Before Win10 we had to employ 'Sleep 16' after timeBeginPeriod because it took two clock ticks to 'bite'. We don't need to use timeEndPeriod, Windows does that for us when the process terminates.

    Leave a comment:


  • Jim Fritts
    replied
    Silence.zip

    Leave a comment:


  • Jim Fritts
    replied
    Rodney's code modified by Jim Fritts
    Code:
    #PBFORMS CREATED V2.00
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    ' The first line in this file is a PB/Forms metastatement.
    ' It should ALWAYS be the first line of the file. Other
    ' PB/Forms metastatements are placed at the beginning and
    ' end of "Named Blocks" of code that should be edited
    ' with PBForms only. Do not manually edit or delete these
    ' metastatements or PB/Forms will not be able to reread
    ' the file correctly.  See the PB/Forms documentation for
    ' more information.
    ' Named blocks begin like this:    #PBFORMS BEGIN ...
    ' Named blocks end like this:      #PBFORMS END ...
    ' Other PB/Forms metastatements such as:
    '     #PBFORMS DECLARATIONS
    ' are used by PB/Forms to insert additional code.
    ' Feel free to make changes anywhere else in the file.
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    'https://forum.powerbasic.com/forum/user-to-user-discussions/programming/54531-not-the-usual-speed-issue#post54531
    
    #COMPILE EXE
    #DIM ALL
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** Includes **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    #PBFORMS BEGIN INCLUDES
    #INCLUDE ONCE "WIN32API.INC"
    #PBFORMS END INCLUDES
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '#RESOURCE ICON, 7219, "C:\PBWin10\iconsFC\flasher4.ico"
    
    MACRO circle (xx,yy,rr,colour)= GRAPHIC ELLIPSE (xx-rr,yy-rr)-(xx+rr,yy+rr),colour,colour
    MACRO circlet (xx,yy,rr,colour)= GRAPHIC ELLIPSE (xx-rr,yy-rr)-(xx+rr,yy+rr),colour
    
    TYPE locator
      x       AS DOUBLE
      z       AS DOUBLE
    END TYPE
    
    TYPE star
      x       AS DOUBLE
      y       AS DOUBLE
      z       AS DOUBLE
      velx    AS DOUBLE
      vely    AS DOUBLE
      velz    AS DOUBLE
      colr    AS LONG
      hilite  AS LONG
      mass    AS DOUBLE
      unts    AS DOUBLE
      allun   AS EXT
      'temx    AS double
      'temy    AS double
      'temz    AS double                           #RESOURCE ICON, 7307, "C:\PBWin10\iconsFC\pointer1.ico"
      'radius  AS double
    END TYPE
    GLOBAL hDlg                          AS DWORD
    GLOBAL MyBaseFreq                    AS DWORD
    GLOBAL winw, winh, wloc, hloc,cntr, gwin, ggwin AS LONG
    GLOBAL wwyd, whyt, pwyd, phyt, cwyd, chyt, nwyd, nhyt AS DOUBLE
    GLOBAL cx, cy, tx, ty, wyd, hyt, pi, rr, r, factor, xwyd, yhyt AS DOUBLE
    GLOBAL focuss(), lfocuss() AS DOUBLE
    GLOBAL orientate, rotation, indic, indi1, indi2, indi3, indicol, clrd AS LONG
    GLOBAL clus1, clus2, spin, bodies, frames, shwall, shwfl, shwno AS LONG
    GLOBAL uflag, xx, yy, zz, tt, dc1, df1, dc2, df2 AS DOUBLE
    GLOBAL clsst1, frthst1, clsst2, frthst2 AS LONG
    GLOBAL tmr, ftmr, bigun AS EXT
    GLOBAL totalstars, xxx, yyy AS LONG
    GLOBAL temstr,img, imtemp AS STRING
    GLOBAL sect() AS STRING
    GLOBAL cbsel, fnt, fnt1, fnt2, showit AS LONG
    GLOBAL str(), fstr() AS star      'str() AS star,
    
    GLOBAL gzFileX1                 AS STRING 'path and file name for accelerating hombot speed silence.mp3
    
    GLOBAL hMixer                   AS DWORD
    
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** Constants **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    #PBFORMS BEGIN CONSTANTS
    %IDD_DIALOG1            =  101  '*
    %IDC_COMBOBOX1          = 1001  '*
    %IDC_LABEL1             = 1002  '*
    %IDC_HIGHLIGHTOPT       = 1003
    %IDC_LOWLIGHTOPT        = 1004
    %IDC_NEITHEROPT         = 1005
    %IDC_YELLOWSOPT         = 1006
    %IDC_MAGENTASOPT        = 1007
    %IDC_GREENSOPT          = 1008
    %IDC_BLUESOPT           = 1009
    %IDC_GRAYSOPT           = 1010
    %IDC_MIXTURESOPT        = 1011
    %IDCANCEL               =    2
    %IDC_YELLOWSOPT2        = 1012
    %IDC_MAGENTASOPT2       = 1013
    %IDC_GREENSOPT2         = 1014
    %IDC_BLUESOPT2          = 1015
    %IDC_GRAYSOPT2          = 1016
    %IDC_MIXTURESOPT2       = 1017
    %IDC_YELLOWHILO         = 1018
    %IDC_MAGENTAHILO        = 1019
    %IDC_CYANHILO           = 1020
    %IDC_WHITEHILO          = 1021
    %IDC_LABEL2             = 1024
    %IDC_LABEL3             = 1025
    %IDC_STARSPERCLUSTER    = 1026
    %IDC_FRAMES             = 1027
    %IDC_LABEL4             = 1028
    %IDC_LABEL5             = 1029
    %IDC_LABEL6             = 1030
    %IDC_LABEL7             = 1031
    %IDC_SAVEALL            = 1033
    %IDC_SAVEFIRSTLAST      = 1034
    %IDC_SAVENO             = 1035
    %IDC_SHOWFINALFRAMEONLY = 1036
    %IDC_START              = 1037
    %IDC_CLOCKWISE          = 1038
    %IDC_COUNTERCLOCKWISE   = 1039
    %IDC_LABEL8             = 1040  '*
    %IDC_FRAME1             = 1041
    %IDC_FRAME2             = 1042
    %IDC_LABEL9             = 1043
    %IDC_LABEL10            = 1044
    %IDD_DIALOG2            =  101
    #PBFORMS END CONSTANTS
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** Declarations **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    DECLARE CALLBACK FUNCTION ShowDIALOG2Proc()
    DECLARE FUNCTION ShowDIALOG2(BYVAL hParent AS DWORD) AS LONG
    #PBFORMS DECLARATIONS
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** Main Application Entry Point **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    FUNCTION PBMAIN()
        'Mine is 0x00000893 (2195000000) dword
        MyBaseFreq = BaseFrequency()
        '? str$(MyBaseFreq)
    
        ShowDIALOG2 %HWND_DESKTOP
    END FUNCTION
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** CallBacks **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG2Proc()
    '  STATIC winw, winh, wloc, hloc,cntr, gwin, ggwin AS LONG
    '  STATIC wwyd, whyt, pwyd, phyt, cwyd, chyt, nwyd, nhyt AS DOUBLE
    '  STATIC cx, cy, tx, ty, wyd, hyt, pi, rr, r, factor, xwyd, yhyt AS DOUBLE
    '  STATIC focuss(), lfocuss() AS DOUBLE
    '  STATIC orientate, rotation, indic, indi1, indi2, indi3, indicol, clrd AS LONG
    '  STATIC clus1, clus2, spin, bodies, frames, shwall, shwfl, shwno AS LONG
    '  STATIC uflag, xx, yy, zz, tt, dc1, df1, dc2, df2 AS DOUBLE
    '  STATIC clsst1, frthst1, clsst2, frthst2 AS LONG
    '  STATIC tmr, ftmr, bigun AS EXT
    '  STATIC totalstars, xxx, yyy AS LONG
    '  STATIC temstr,img, imtemp AS STRING
    '  STATIC sect() AS STRING
    '  STATIC cbsel, fnt, fnt1, fnt2, showit AS LONG
    '  STATIC str(), fstr() AS star      'str() AS star,
      LOCAL gravity, temp AS DOUBLE
      LOCAL cnts AS LONG
      LOCAL st AS star PTR
      STATIC slow(), fast(), slw(), fst() AS locator
      LOCAL Result       AS LONG
      LOCAL Done1        AS QUAD
      LOCAL Start1       AS QUAD
      LOCAL Done2        AS QUAD
      LOCAL Start2       AS QUAD
    
    
      FONT NEW "Arial", 12, 0 TO fnt
      FONT NEW "MS Sans Serif", 10, 0, %ANSI_CHARSET TO fnt2
      FONT NEW "Arial", 14, 1, %ANSI_CHARSET TO fnt1
      imtemp="Multi_"+dattim
      gravity= -0.0000000000667384
      pi = ATN(1) * 4
      SELECT CASE AS LONG CB.MSG
    
        CASE %MM_MCINOTIFY
            ' This is sent from MCI to tell us what's happening...
            IF (CB.WPARAM = %MCI_NOTIFY_SUCCESSFUL) THEN
                CALL RESTART_ACCELERATOR
            END IF
    
        CASE %WM_INITDIALOG
          hDlg = CB.HNDL
          CALL START_ACCELERATOR
          ' Initialization handler
          CONTROL SET OPTION CB.HNDL, %IDC_NEITHEROPT, %IDC_HIGHLIGHTOPT, %IDC_NEITHEROPT
          CONTROL SET OPTION CB.HNDL, %IDC_WHITEHILO, %IDC_YELLOWHILO, %IDC_WHITEHILO
          CONTROL SET OPTION CB.HNDL, %IDC_MAGENTASOPT, %IDC_YELLOWSOPT, %IDC_MIXTURESOPT
          CONTROL SET OPTION CB.HNDL, %IDC_YELLOWSOPT2, %IDC_YELLOWSOPT2, %IDC_MIXTURESOPT2
          CONTROL SET OPTION CB.HNDL, %IDC_SAVENO, %IDC_SAVEALL, %IDC_SAVENO
          CONTROL SET OPTION CB.HNDL, %IDC_CLOCKWISE, %IDC_CLOCKWISE, %IDC_COUNTERCLOCKWISE
          DESKTOP GET CLIENT TO winw, winh                'dialog height is 223
          wloc = winw/2-200
          hloc = winh/2-312
          cwyd=winw/2
          chyt=winh/2
          nwyd=401
          nhyt=401
          xwyd=200
          yhyt=200
          r=380/2
          factor= 473351040000000000/r
          DIALOG SET LOC CB.HNDL, wloc-100, hloc+403
        CASE %WM_NCACTIVATE
          STATIC hWndSaveFocus AS DWORD
          IF ISFALSE CB.WPARAM THEN
            ' Save control focus
            hWndSaveFocus = GetFocus()
          ELSEIF hWndSaveFocus THEN
            ' Restore control focus
            SetFocus(hWndSaveFocus)
            hWndSaveFocus = 0
          END IF
        CASE %WM_USER + 200
    
          COMBOBOX GET SELECT CB.HNDL, %IDC_COMBOBOX1 TO cbsel
          CONTROL GET CHECK CB.HNDL, %IDC_HIGHLIGHTOPT TO indi1
          CONTROL GET CHECK CB.HNDL, %IDC_LOWLIGHTOPT TO indi2
          CONTROL GET CHECK CB.HNDL, %IDC_NEITHEROPT TO indi3
          CONTROL GET CHECK CB.HNDL, %IDC_SHOWFINALFRAMEONLY TO showit
          CONTROL GET CHECK CB.HNDL, %IDC_SAVEALL TO shwall
          CONTROL GET CHECK CB.HNDL, %IDC_SAVEFIRSTLAST TO shwfl
          CONTROL GET CHECK CB.HNDL, %IDC_SAVENO TO shwno
          IF ISTRUE indi1 THEN
            indic=1
          ELSEIF ISTRUE indi2 THEN
            indic=2
          ELSEIF ISTRUE indi3 THEN
            indic=0
          END IF
          indicol=0
          FOR cntr=%IDC_YELLOWHILO TO %IDC_WHITEHILO
            INCR indicol
            CONTROL GET CHECK CB.HNDL, cntr TO indi1
            IF ISTRUE indi1 THEN EXIT FOR
          NEXT cntr
          SELECT CASE indicol
            CASE 1
              clrd=RGB(191,031,047)
            CASE 2
              clrd=RGB(128,127,255)
            CASE 3
              clrd=%RGB_DARKKHAKI
            CASE 4
              clrd= %RGB_GAINSBORO
          END SELECT
          clus1=0
          FOR cntr=%IDC_YELLOWSOPT TO %IDC_MIXTURESOPT
            INCR clus1
            CONTROL GET CHECK CB.HNDL, cntr TO indi1
            IF ISTRUE indi1 THEN EXIT FOR
          NEXT cntr
          clus2=0
          FOR cntr=%IDC_YELLOWSOPT2  TO %IDC_MIXTURESOPT2
            INCR clus2
            CONTROL GET CHECK CB.HNDL, cntr TO indi1
            IF ISTRUE indi1 THEN EXIT FOR
          NEXT cntr
          CONTROL GET CHECK CB.HNDL, %IDC_CLOCKWISE TO spin
          CONTROL GET TEXT CB.HNDL, %IDC_STARSPERCLUSTER TO temstr
          bodies=VAL(temstr)
          CONTROL GET TEXT CB.HNDL, %IDC_FRAMES TO temstr
          frames=VAL(temstr)
          totalstars=bodies*2+1
          REDIM str(totalstars)
          REDIM fstr(totalstars)
          REDIM slow(frames), fast(frames), slw(frames), fst(frames)
          DIALOG HIDE CB.HNDL
          IF ISFALSE gwin THEN
            GRAPHIC WINDOW NEW "",wloc-201 ,hloc ,nwyd,nhyt TO gWin
            DIALOG SET ICON CB.HNDL, "#7219"
            DIALOG SET ICON gwin, "#7219"
            DIALOG SET TEXT gwin, "SpiralGalaxy-all pairs"
            GRAPHIC ATTACH gwin,0, REDRAW
            GRAPHIC SET OVERLAP 1
            GRAPHIC CLEAR %BLACK
            GRAPHIC COLOR %MAGENTA,%BLACK
            GRAPHIC SCALE (-xwyd,-yhyt)-(xwyd, yhyt)
    
            GRAPHIC WINDOW NEW "",wloc+201 ,hloc ,nwyd,nhyt TO ggWin
            DIALOG SET ICON CB.HNDL, "#7219"
            DIALOG SET ICON ggwin, "#7219"
            DIALOG SET TEXT ggwin, "SpiralGalaxy-all bodies"
            GRAPHIC ATTACH ggwin,0, REDRAW
            GRAPHIC SET OVERLAP 1
            GRAPHIC CLEAR %BLACK
            GRAPHIC COLOR %MAGENTA,%BLACK
            GRAPHIC SCALE (-xwyd,-yhyt)-(xwyd, yhyt)
            GRAPHIC REDRAW
    
            GRAPHIC ATTACH gwin,0, REDRAW
            GRAPHIC WINDOW HIDE gwin
          END IF
          filler gwin, ggwin, str(),totalstars, indicol, clus1, clus2, factor, spin
    
    
          FOR cntr=0 TO totalstars             'find the smallest mass- could be done in the sub fillit
            IF cntr=0 THEN
              uflag=str(cntr).mass
            ELSEIF uflag>str(cntr).mass THEN
              uflag=str(cntr).mass
            END IF
    
            xx=str(cntr).x-0
            yy=str(cntr).y-0
            zz=str(cntr).z-0
            tt=SQR(xx*xx+yy*yy+zz*zz)
            IF cntr=0 THEN
              clsst1    =cntr
              dc1       =tt
              frthst1   =cntr
              df1       =tt
              clsst2    =cntr
              dc2       =tt
              frthst2   =cntr
              df2       =tt
            ELSE
              IF str(cntr).x<0 THEN
                IF tt>dc2 THEN
                  dc2= tt
                  clsst2=cntr
                ELSEIF tt<df2 THEN
                  df2=tt
                  frthst2=cntr
                END IF
              ELSEIF str(cntr).x>0 THEN
                IF tt<dc1 THEN
                  dc1=tt
                  clsst1=cntr
                ELSEIF tt>df1 THEN
                  df1=tt
                  frthst1=cntr
                END IF
              END IF
            END IF
            'if cntr=50 or cntr=60 then msgbox "closest neg "+format$(dc2)+$crlf+"furthest neg "+format$(df2)+$crlf+format$(dc1)+$crlf+format$(df1)
          NEXT cntr
          RESET bigun
          FOR cntr=0 TO totalstars      'calculate the number of 'smallest masses' that would fit in mass
            str(cntr).unts= str(cntr).mass/uflag
            bigun+=str(cntr).unts
          NEXT cntr
    
          FOR cntr=0 TO totalstars
            fstr(cntr).x      = str(cntr).x
            fstr(cntr).z      = str(cntr).z
            fstr(cntr).y      = str(cntr).y
            fstr(cntr).velz   = str(cntr).velz
            fstr(cntr).velx   = str(cntr).velx
            fstr(cntr).vely   = str(cntr).vely
            fstr(cntr).mass   = str(cntr).mass
            fstr(cntr).colr   = str(cntr).colr
            fstr(cntr).hilite = str(cntr).hilite
            fstr(cntr).unts   = str(cntr).unts
            fstr(cntr).allun  = bigun-fstr(cntr).unts
          NEXT cntr
          uflag=gravity*uflag
          GOTO jumpin
    
          TIX Start1
          'tmr=TIMER
          FOR cntr=1 TO frames
            'if cntr>1 then tmr=TIMER-tm:msgbox format$(tmr)
            flexit str(),totalstars, uflag     'do the calculations  , clsst1, frthst1, clsst2, frthst2
            'tm=TIMER
            'DIALOG DOEVENTS 2
            'if isfalse showit then
            flashit str(),totalstars, cntr, clrd, clsst1, frthst1, indic, factor, r, frames, slow(), fast() ', wyd, hyt    'show the results
            'elseif istrue showit and cntr=frames then
              'flashit str(),totalstars, cntr, focuss(), clrd, gwin, clsst1, frthst1, indic, factor, r, frames ', wyd, hyt    'show the results
            'end if
            GRAPHIC SET POS (-xwyd+10, -yhyt+10)
            'GRAPHIC PRINT "PRIMARY VIEW"
            GRAPHIC PRINT "Frame # "cntr"/" frames '" of " totalstars " stars"
            GRAPHIC PRINT "   Stars : " totalstars
            GRAPHIC SET POS (xwyd-150, -yhyt+1)
            GRAPHIC COLOR RGB(0,0,25), %BLACK
            GRAPHIC PRINT "Copyright 2012, Rodney Hicks"
            GRAPHIC REDRAW
            GRAPHIC COLOR %MAGENTA, %BLACK
            IF ISTRUE shwno THEN         ' s$ = STRINSERT$(MainStr$, NewStr$, position&)
              IF cntr=1 THEN
                imtemp=dattim
                imtemp=STRINSERT$(imtemp,"_",9)
                imtemp="spi_"+imtemp
                'msgbox imtemp
              END IF
            ELSE
              IF ISTRUE shwall THEN
                imtemp=dattim
                imtemp=STRINSERT$(imtemp,"_",9)
                imtemp="spi_"+imtemp
                img=imtemp+"_"+FORMAT$(cntr,"000000")+".BMP"
                GRAPHIC SAVE img
              ELSEIF ISTRUE shwfl AND (cntr=1 OR cntr=frames) THEN
                imtemp=dattim
                imtemp=STRINSERT$(imtemp,"_",9)
                imtemp="spi_"+imtemp
                img=imtemp+"_"+FORMAT$(cntr,"000000")+".BMP"
                GRAPHIC SAVE img
              END IF
            END IF
          NEXT cntr
          TIX Done1
    
    
          'MSGBOX "Elapsed time(sec) :"+ FORMAT$(TIMER-tmr)+$CRLF+ "Elapsed time(min) :"+ _
          'FORMAT$((TIMER-tmr)/60), %MB_TASKMODAL
    
          MSGBOX "Elapsed time(sec) :"+ _
                 FORMAT$((Done1-Start1)/MyBaseFreq,"###.00") + _
                 $CRLF + _
                 "Elapsed time(min) :" + _
                 FORMAT$((Done1-Start1)/MyBaseFreq/60,"###.00") + _
                 $CRLF + _
                 "Frames/sec :" + _
                 FORMAT$(Frames/((Done1-Start1)/MyBaseFreq),"###.00"), _
                 %MB_TASKMODAL
    
    
     Jumpin:
         CALL OpenDisplayThread
    
    
        CASE %WM_COMMAND
          ' Process control notifications
          SELECT CASE AS LONG CB.CTL
            CASE %IDC_HIGHLIGHTOPT
    
            CASE %IDC_LOWLIGHTOPT
    
            CASE %IDC_NEITHEROPT
    
            CASE %IDC_YELLOWHILO
    
            CASE %IDC_MAGENTAHILO
    
            CASE %IDC_CYANHILO
    
            CASE %IDC_WHITEHILO
    
            CASE %IDC_YELLOWSOPT
    
            CASE %IDC_MAGENTASOPT
    
            CASE %IDC_GREENSOPT
    
            CASE %IDC_BLUESOPT
    
            CASE %IDC_GRAYSOPT
    
            CASE %IDC_MIXTURESOPT
    
            CASE %IDC_YELLOWSOPT2
    
            CASE %IDC_MAGENTASOPT2
    
            CASE %IDC_GREENSOPT2
    
            CASE %IDC_BLUESOPT2
    
            CASE %IDC_GRAYSOPT2
    
            CASE %IDC_MIXTURESOPT2
    
            CASE %IDC_START
              IF CB.CTLMSG = %BN_CLICKED OR CB.CTLMSG = 1 THEN
                DIALOG POST CB.HNDL, %WM_USER + 200, 0, 0
                'MSGBOX "%IDC_START=" + FORMAT$(%IDC_START), %MB_TASKMODAL
              END IF
    
            CASE %IDC_STARSPERCLUSTER
    
            CASE %IDC_FRAMES
    
            CASE %IDC_SAVEALL
    
            CASE %IDC_SAVEFIRSTLAST
    
            CASE %IDC_SAVENO
    
            CASE %IDC_SHOWFINALFRAMEONLY
    
            CASE %IDCANCEL
              IF CB.CTLMSG = %BN_CLICKED OR CB.CTLMSG = 1 THEN
                GRAPHIC WINDOW END gwin
                DIALOG END CB.HNDL, 0
              END IF
    
            CASE %IDC_CLOCKWISE
    
            CASE %IDC_COUNTERCLOCKWISE
    
          END SELECT
      END SELECT
    END FUNCTION
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    '   ** Dialogs **
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    FUNCTION ShowDIALOG2(BYVAL hParent AS DWORD) AS LONG
      LOCAL lRslt  AS LONG
      LOCAL Result AS LONG
    
    #PBFORMS BEGIN DIALOG %IDD_DIALOG2->->
      LOCAL hDlg   AS DWORD
      LOCAL hFont1 AS DWORD
    
      DIALOG NEW PIXELS, hParent, "", 124, 485, 600, 223, %WS_POPUP OR %WS_VISIBLE OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, %WS_EX_CONTROLPARENT OR _
        %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
      DIALOG  SET COLOR     hDlg, %WHITE, %BLACK
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_HIGHLIGHTOPT, "Highlight", 96, 48, 75, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_NOTIFY OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_HIGHLIGHTOPT, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_LOWLIGHTOPT, "Lowlight", 96, 64, 75, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR %BS_AUTORADIOBUTTON OR _
        %BS_NOTIFY OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LOWLIGHTOPT, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_NEITHEROPT, "Neither", 96, 80, 75, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_TEXT OR %BS_AUTORADIOBUTTON OR _
        %BS_NOTIFY OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_NEITHEROPT, %WHITE, -2
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_YELLOWHILO, "Dark Red", 208, 48, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_YELLOWHILO, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_MAGENTAHILO, "Purple", 208, 64, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_MAGENTAHILO, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_CYANHILO, "Gold", 208, 80, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_CYANHILO, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_WHITEHILO, "Gray", 208, 96, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_WHITEHILO, %WHITE, -2
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_YELLOWSOPT, "Yellows", 320, 48, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_YELLOWSOPT, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_MAGENTASOPT, "Magentas", 320, 64, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_MAGENTASOPT, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_GRAYSOPT, "Grays", 320, 80, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_GRAYSOPT, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_MIXTURESOPT, "Mixtures", 320, 96, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_MIXTURESOPT, %WHITE, -2
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_YELLOWSOPT2, "Yellows", 432, 48, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_YELLOWSOPT2, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_MAGENTASOPT2, "Magentas", 432, 64, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_MAGENTASOPT2, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_GRAYSOPT2, "Grays", 432, 80, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_GRAYSOPT2, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_MIXTURESOPT2, "Mixtures", 432, 96, 80, 16
      CONTROL SET COLOR     hDlg, %IDC_MIXTURESOPT2, %WHITE, -2
      ' %WS_GROUP...
      CONTROL ADD BUTTON,   hDlg, %IDC_START, "Start", 360, 184, 123, 24, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR %BS_PUSHBUTTON OR _
        %BS_CENTER OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL ADD TEXTBOX,  hDlg, %IDC_STARSPERCLUSTER, "2500", 8, 184, 150, 21, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_CENTER OR %ES_AUTOHSCROLL OR _
        %ES_NUMBER, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
      CONTROL ADD TEXTBOX,  hDlg, %IDC_FRAMES, "10000", 200, 184, 150, 21, %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %ES_CENTER OR %ES_AUTOHSCROLL OR %ES_NUMBER, _
        %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_SAVEALL, "Save all Bitmaps", 208, 128, 175, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_SAVEALL, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_SAVEFIRSTLAST, "Save First/Last Bitmaps", 208, 144, 175, 16
      CONTROL SET COLOR     hDlg, %IDC_SAVEFIRSTLAST, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_SAVENO, "Save No Bitmaps", 392, 128, 175, 16
      CONTROL SET COLOR     hDlg, %IDC_SAVENO, %WHITE, -2
      ' %WS_GROUP...
     ' CONTROL ADD CHECKBOX, hDlg, %IDC_SHOWFINALFRAMEONLY, "Show Final Frame Only", 400, 160, 160, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR _
       ' %BS_TEXT OR %BS_AUTOCHECKBOX OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_SHOWFINALFRAMEONLY, %WHITE, -2
      CONTROL ADD BUTTON,   hDlg, %IDCANCEL, "Exit", 520, 184, 75, 24
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL2, "Stars per cluster", 8, 168, 150, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL2, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL3, "Frames", 200, 168, 150, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL3, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL4, "Indicator", 96, 32, 75, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL4, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL5, "Cluster 1", 320, 32, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL5, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL6, "Cluster 2", 432, 32, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL6, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL7, "Colours", 208, 32, 80, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL7, %WHITE, -2
      ' %WS_GROUP...
      CONTROL ADD OPTION,   hDlg, %IDC_CLOCKWISE, "Clockwise", 48, 128, 150, 16, %WS_CHILD OR %WS_VISIBLE OR %WS_GROUP OR %WS_TABSTOP OR %BS_TEXT OR _
        %BS_AUTORADIOBUTTON OR %BS_LEFT OR %BS_VCENTER, %WS_EX_LEFT OR %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_CLOCKWISE, %WHITE, -2
      CONTROL ADD OPTION,   hDlg, %IDC_COUNTERCLOCKWISE, "Counter-Clockwise", 48, 144, 150, 16
      CONTROL SET COLOR     hDlg, %IDC_COUNTERCLOCKWISE, %WHITE, -2
      CONTROL ADD FRAME,    hDlg, %IDC_FRAME1, "", 88, 16, 208, 104
      CONTROL SET COLOR     hDlg, %IDC_FRAME1, %WHITE, -2
      CONTROL ADD FRAME,    hDlg, %IDC_FRAME2, "", 312, 16, 208, 104
      CONTROL SET COLOR     hDlg, %IDC_FRAME2, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL9, "Slowest Moving", 88, 8, 208, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER OR %SS_CENTERIMAGE, %WS_EX_LEFT OR _
        %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL9, %WHITE, -2
      CONTROL ADD LABEL,    hDlg, %IDC_LABEL10, "Star Colours", 312, 8, 208, 16, %WS_CHILD OR %WS_VISIBLE OR %SS_CENTER OR %SS_CENTERIMAGE, %WS_EX_LEFT OR _
        %WS_EX_LTRREADING
      CONTROL SET COLOR     hDlg, %IDC_LABEL10, %WHITE, -2
    
      FONT NEW "MS Sans Serif", 10, 0, %ANSI_CHARSET TO hFont1
    
      CONTROL SET FONT hDlg, %IDC_HIGHLIGHTOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_LOWLIGHTOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_NEITHEROPT, hFont1
      CONTROL SET FONT hDlg, %IDC_YELLOWHILO, hFont1
      CONTROL SET FONT hDlg, %IDC_MAGENTAHILO, hFont1
      CONTROL SET FONT hDlg, %IDC_CYANHILO, hFont1
      CONTROL SET FONT hDlg, %IDC_WHITEHILO, hFont1
      CONTROL SET FONT hDlg, %IDC_YELLOWSOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_MAGENTASOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_GREENSOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_MIXTURESOPT, hFont1
      CONTROL SET FONT hDlg, %IDC_YELLOWSOPT2, hFont1
      CONTROL SET FONT hDlg, %IDC_MAGENTASOPT2, hFont1
      CONTROL SET FONT hDlg, %IDC_GREENSOPT2, hFont1
      CONTROL SET FONT hDlg, %IDC_MIXTURESOPT2, hFont1
      CONTROL SET FONT hDlg, %IDC_START, hFont1
      CONTROL SET FONT hDlg, %IDC_STARSPERCLUSTER, hFont1
      CONTROL SET FONT hDlg, %IDC_FRAMES, hFont1
      CONTROL SET FONT hDlg, %IDC_SAVEALL, hFont1
      CONTROL SET FONT hDlg, %IDC_SAVEFIRSTLAST, hFont1
      CONTROL SET FONT hDlg, %IDC_SAVENO, hFont1
      CONTROL SET FONT hDlg, %IDC_SHOWFINALFRAMEONLY, hFont1
      CONTROL SET FONT hDlg, %IDCANCEL, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL2, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL3, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL4, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL5, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL6, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL7, hFont1
      CONTROL SET FONT hDlg, %IDC_CLOCKWISE, hFont1
      CONTROL SET FONT hDlg, %IDC_COUNTERCLOCKWISE, hFont1
      CONTROL SET FONT hDlg, %IDC_FRAME1, hFont1
      CONTROL SET FONT hDlg, %IDC_FRAME2, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL9, hFont1
      CONTROL SET FONT hDlg, %IDC_LABEL10, hFont1
    #PBFORMS END DIALOG
        CONTROL SHOW STATE hDlg, %IDC_SAVEALL, %SW_HIDE
      DIALOG SHOW MODAL hDlg, CALL ShowDIALOG2Proc TO lRslt
    
    
    #PBFORMS BEGIN CLEANUP %IDD_DIALOG2
      FONT END hFont1
    #PBFORMS END CLEANUP
    
      FUNCTION = lRslt
    END FUNCTION
    '--------------------------------------------------------------------------------------------------------------------------------------------------------------
    FUNCTION Dater() COMMON AS STRING
      dater=RIGHT$(DATE$,4)+"-"+LEFT$(DATE$,5)  'changes MM-DD-YYYY to YYYY-MM-DD SLL format
    END FUNCTION
    
    FUNCTION datel() COMMON AS STRING
      datel=REMOVE$(dater,"-")                  'changes YYYY-MM-DD to YYYYMMDD SLL format
    END FUNCTION
    
    FUNCTION dattim() COMMON AS STRING
      dattim= datel+REMOVE$(TIME$,":")          'creates a YYYYMMDDHHMMSS string SLL format
    END FUNCTION
    
    SUB fillculler(clust1 AS LONG, clust2 AS LONG, clr1() AS LONG, clr2() AS LONG)
      LOCAL cnts,ar, ge, be,c1, c2 AS LONG
      ar=99
      ge=99
      be=99
      SELECT CASE AS LONG clust1
        CASE 1
          ar =86
          ge =86
          be =0
        CASE 2
          ar =86
          ge =0
          be =86
        CASE 3
          ar =0
          ge =86
          be =0
        CASE 4
          ar =0
          ge =0
          be =86
        CASE 5
          ar =73
          ge =73
          be =73
        CASE 6
          ar =(RND(1,13))*13+86
          ge =(RND(1,13))*13+86
          be =(RND(1,13))*13+86
      END SELECT
      FOR cnts=1 TO 13
        IF clust1<6 THEN
          IF ISTRUE ar THEN
            ar+=(cnts*13)
          END IF
          IF ISTRUE ge THEN
            ge+=(cnts*13)
          END IF
          IF ISTRUE be THEN
            be+=(cnts*13)
          END IF
          clr1(cnts)=RGB(ar,ge,be)
        ELSE
          ar =(RND(1,13))*13+86
          ge =(RND(1,13))*13+86
          be =(RND(1,13))*13+86
          clr1(cnts)=RGB(ar,ge,be)
        END IF
      NEXT cnts
      SELECT CASE AS LONG clust2
        CASE 1
          ar =86
          ge =86
          be =0
        CASE 2
          ar =86
          ge =0
          be =86
        CASE 3
          ar =0
          ge =86
          be =0
        CASE 4
          ar =0
          ge =0
          be =86
        CASE 5
          ar =73
          ge =73
          be =73
        CASE 6
          ar =(RND(1,13))*13+86
          ge =(RND(1,13))*13+86
          be =(RND(1,13))*13+86
      END SELECT
      FOR cnts=1 TO 13
        IF clust2<6 THEN
          IF ISTRUE ar THEN
            ar+=(cnts*13)
          END IF
          IF ISTRUE ge THEN
            ge+=(cnts*13)
          END IF
          IF ISTRUE be THEN
            be+=(cnts*13)
          END IF
          clr2(cnts)=RGB(ar,ge,be)
        ELSE
          ar =(RND(1,13))*13+86
          ge =(RND(1,13))*13+86
          be =(RND(1,13))*13+86
          clr2(cnts)=RGB(ar,ge,be)
        END IF
      NEXT cnts
    END SUB
    SUB filler(gwin AS LONG, ggwin AS LONG, str() AS star,tp AS LONG, hilo AS LONG, clust1 AS LONG, clust2 AS LONG, factor AS DOUBLE, spn AS LONG)
      LOCAL inky AS STRING
      LOCAL pn, nn, kolour, kolour2, weit, cntr, zspd, xspd, yspd, bh AS LONG
      LOCAL xloc, ln, yloc, zloc, dist, pi, dst, sol, velm AS DOUBLE
      LOCAL angl AS SINGLE
      LOCAL clr1(), clr2() AS LONG
      DIM clr1(13), clr2(13)
      fillculler clust1,clust2,clr1(),clr2()
      bh=1
      pi = 4 * ATN(1)
      sol= 1.989e30
    
      pn=1
      'IF ISTRUE bh THEN
        dst=SQR((200343072000000000^2)/2)               '260343072000000000
        velm= 90000000000000             ' 17500000000000
      'ELSE
      '  dst=SQR((189340416000000000^2)/2)
      '  velm= 100000000
      'END IF
      FOR cntr=0 TO tp
        nn=RND(1,2)
        IF nn=2 THEN
        nn=-1
        END IF
        ln=RND(0,2147483647)*30000000
        pn=pn * -1
        weit=RND(1,10)
        IF weit=10 THEN
          weit=RND(10,1600)
        END IF
        IF weit=160 THEN
          weit=RND(1600, 2500)
        END IF
        IF cntr=tp AND bh=1 THEN
          weit=1500000000'0
        END IF
        IF pn=1 THEN
          kolour2 = %CYAN
        ELSE
          kolour2 = %WHITE
        END IF
        SELECT CASE AS LONG weit
          CASE 1 TO 9
            IF pn=1 THEN
              kolour  = clr1(weit)
            ELSE
              kolour  = clr2(weit)
            END IF
    '      CASE 2
    '        IF pn=1 THEN
    '          kolour= RGB(138,138,000)
    '        ELSE
    '          kolour= RGB(138,000,138)
    '        END IF
    '      CASE 3
    '        IF pn=1 THEN
    '          kolour= RGB(151,151,000)
    '        ELSE
    '          kolour= RGB(151,000,151)
    '        END IF
    '      CASE 4
    '        IF pn=1 THEN
    '          kolour= RGB(164,164,000)
    '        ELSE
    '          kolour= RGB(164,000,164)
    '        END IF
    '      CASE 5
    '        IF pn=1 THEN
    '          kolour= RGB(177,177,000)
    '        ELSE
    '          kolour= RGB(177,000,177)
    '        END IF
    '      CASE 6
    '        IF pn=1 THEN
    '          kolour= RGB(190,190,000)
    '        ELSE
    '          kolour= RGB(190,000,190)
    '        END IF
    '      CASE 7
    '        IF pn=1 THEN
    '          kolour= RGB(203,203,000)
    '        ELSE
    '          kolour= RGB(203,000,203)
    '        END IF
    '      CASE 8
    '        IF pn=1 THEN
    '          kolour= RGB(216,216,000)
    '        ELSE
    '          kolour= RGB(216,000,216)
    '        END IF
    '      CASE 9
    '        IF pn=1 THEN
    '          kolour= RGB(229,229,000)
    '        ELSE
    '          kolour= RGB(229,000,229)
    '        END IF
          CASE 10 TO 399
            IF pn=1 THEN
              kolour= clr1(10)
            ELSE
              kolour= clr2(10)
            END IF
          CASE 400 TO 799
            IF pn=1 THEN
              kolour= clr1(11)
            ELSE
              kolour= clr2(11)
            END IF
          CASE 800 TO 1199
            IF pn=1 THEN
              kolour= clr1(12)
            ELSE
              kolour= clr2(12)
            END IF
          CASE 1200 TO 1599
            IF pn=1 THEN
              kolour= clr1(13)
            ELSE
              kolour= clr2(13)
            END IF
          CASE 1600 TO 2500
            kolour=%WHITE
          CASE >2500
            kolour=%RGB_IVORY
        END SELECT
        IF cntr<tp OR bh=0 THEN
          angl=RND(0,36000)/100            'angle from the cluster centre
          dist=RND*108870739200000000   '108870739200000000    ' increasing this moves the clusters apart
          xspd=RND(-10000,10000)           'random velocities with the cluster   not optimized
          zspd=RND(-10000,10000)           'random velocities with the cluster   not optimized
          yspd=RND(-10000,10000)           'random velocities with the cluster   not optimized
          str(cntr).x      = (pn*dst)+dist*COS(angl*pi/180)+(ln*pn)  'initial x location in cluster
          str(cntr).z      = (ln*pn)+((pn*dst)+dist*SIN(angl*pi/180))    'initial z location in cluster
          str(cntr).y      = RND*32335104000000000*pn*nn'(pn*dst)+dist*sin(angl*pi/180)   'initial y location in cluster
          IF spn=0 THEN
            str(cntr).velz   = zspd+pn*-1* velm  'velocity against the background
            str(cntr).velx   = xspd                    'RND*47335104000000000*pn
          ELSE
            str(cntr).velz   = zspd  'velocity against the background
            str(cntr).velx   = xspd+pn*-1* velm
          END IF
          str(cntr).vely   = yspd
          str(cntr).mass   = weit/10*sol
          str(cntr).colr   = kolour
          str(cntr).hilite = kolour2
        ELSEIF cntr=tp AND bh=1 THEN
          str(cntr).x      = 0'(pn*dst/2)+dist*COS(angl*pi/180)  'initial x location in cluster
          str(cntr).z      = 0'(pn*dst)+dist*SIN(angl*pi/180)    'initial z location in cluster
          str(cntr).y      = 0'RND*47335104000000000*pn          'initial y location in cluster
          str(cntr).velz   = 0'zspd+pn*-1* 78125000000   'velocity against the background
          str(cntr).velx   = 0'xspd
          str(cntr).vely   = 0'yspd
          str(cntr).mass   = weit/10*sol
          str(cntr).colr   = kolour
          str(cntr).hilite = kolour2
        END IF
        GRAPHIC SET PIXEL ((str(cntr).x)/factor,(str(cntr).z)/factor), str(cntr).colr
    
      NEXT cntr
      GRAPHIC REDRAW
      GRAPHIC ATTACH ggwin,0, REDRAW
      FOR cntr=0 TO tp
        GRAPHIC SET PIXEL ((str(cntr).x)/factor,(str(cntr).z)/factor), str(cntr).colr
      NEXT cntr
      GRAPHIC REDRAW
      GRAPHIC ATTACH gwin, 0,REDRAW
    END SUB
    SUB flexit(str() AS star, tp AS DWORD, uf AS DOUBLE)
      LOCAL cntr, cntd AS LONG
      LOCAL temp, tem1, tem2, dx, dy, dz, duh AS DOUBLE
      STATIC s1, s2 AS star PTR
    
      FOR cntr=0 TO tp-1
        s1  = VARPTR (str(cntr))
        FOR cntd=cntr+1 TO tp
          s2        = VARPTR (str(cntd))
          dx        = @[email protected]
          dy        = @[email protected]
          dz        = @[email protected]
          temp      = uf/(dx*dx+dy*dy+dz*dz)  'calc acceleration of the smallest mass
          tem1      = temp*@s2.unts        'assign to complete mass of the first of the pair
          tem2      = -temp*@s1.unts       'assign to complete mass of the second body with opposite direction (-)
          @s1.velx  = @s1.velx+(tem1)*dx
          @s1.vely  = @s1.vely+(tem1)*dy
          @s1.velz  = @s1.velz+(tem1)*dz
          @s2.velx  = @s2.velx+(tem2)*dx
          @s2.vely  = @s2.vely+(tem2)*dy
          @s2.velz  = @s2.velz+(tem2)*dz
        NEXT cntd
        @s1.x     = @[email protected]
        @s1.y     = @[email protected]
        @s1.z     = @[email protected]
    
      NEXT cntr
      s1        = VARPTR (str(tp))
      @s1.x     = @[email protected]
      @s1.y     = @[email protected]
      @s1.z     = @[email protected]
    END SUB
    
    
    SUB flashit(str() AS star,ttp AS DWORD, cnt AS LONG, _
          hili AS LONG, clsst1 AS LONG, frthst1 AS LONG, _
               ind AS LONG, fctr AS DOUBLE, rrr AS DOUBLE, frames AS LONG, _
               slow() AS locator, fast() AS locator)', wyd as double, hyt as double)
      LOCAL cnts,cntd AS LONG
      LOCAL xxx, yyy AS DOUBLE
      LOCAL st AS star PTR
    'circle (xxx,yyy,rrr,%BLACK)
      GRAPHIC CLEAR %BLACK
            circlet (xxx, yyy, rrr, RGB(45,45,45))
            circlet (xxx, yyy, (rrr/2), RGB(45,45,45))
            FOR cnts = 0 TO ttp
              st=VARPTR(str(cnts))
              IF ind=1 THEN
                IF ABS(@st.velx)+ABS(@st.vely)+ABS(@st.velz)<55550050000000  THEN   '0  35550050000000
                  circle ((@st.x*(1/fctr)+xxx), (@st.z*(1/fctr)+yyy), 1, hili)
                END IF
              ELSEIF ind=2 THEN
                IF ABS(@st.velx)+ABS(@st.vely)+ABS(@st.velz)<55550050000000  THEN   '0  35550050000000
                  circle ((@st.x*(1/fctr)+xxx), (@st.z*(1/fctr)+yyy), 1, hili)
                END IF
                'circle (@st.x*(1/fctr), @st.z*(1/fctr), 1, @st.colr)
                GRAPHIC SET PIXEL (@st.x*(1/fctr)+xxx, @st.z*(1/fctr)+yyy), @st.colr
              ELSE
                'circle (@st.x*(1/fctr), @st.z*(1/fctr), (1893404160000000*1), @st.colr)
                GRAPHIC SET PIXEL (@st.x*(1/fctr)+xxx, @st.z*(1/fctr)+yyy), @st.colr
              END IF
            NEXT cnts
            st=VARPTR(str(clsst1))
            circle ((@st.x*(1/fctr)+xxx),(@st.z*(1/fctr)+yyy), 2, %CYAN)
            st=VARPTR(str(frthst1))
            circle ((@st.x*(1/fctr)+xxx), (@st.z*(1/fctr)+yyy), 2, %GREEN)
      ' GRAPHIC SET POS (-190, -190)
            'GRAPHIC PRINT "PRIMARY VIEW"
      ' GRAPHIC PRINT "Frame # "cnt"/" frames " of " ttp " stars"
      'GRAPHIC REDRAW
    END SUB
    
    '_________________________________________________________________
    '
    '   FUNCTION  BaseFrequency
    '_________________________________________________________________
    
    FUNCTION BaseFrequency() AS DWORD
        LOCAL sData AS STRING
        regDataGet(%HKEY_LOCAL_MACHINE, "HARDWARE\DESCRIPTION\System\CentralProcessor\0", "~MHZ", sData)
        FUNCTION = VAL(sData) * 1000000
    END FUNCTION
    
    '_________________________________________________________________
    '
    '   FUNCTION  regDataGet
    '_________________________________________________________________
    
    'Thanks to Pierre Bellisle
    FUNCTION regDataGet(hMainKey AS DWORD, sKeyName AS STRING, sValueName AS STRING, sData AS STRING) AS LONG
     LOCAL Retval    AS LONG
     LOCAL dwSize    AS DWORD
     LOCAL hKey      AS DWORD
     LOCAL dwRegType AS DWORD
    
     sData = ""
     IF RegOpenKeyExA(hMainKey, BYVAL STRPTR(sKeyName), BYVAL %NULL, %KEY_READ, hKey) = %ERROR_SUCCESS THEN
         Retval = RegQueryValueExA(hKey, BYVAL STRPTR(sValueName), BYVAL %NULL, _
                                  BYVAL %NULL, BYVAL %NULL, dwSize)
         IF Retval = %ERROR_SUCCESS THEN
             sData = NUL$(dwSize)
             Retval = RegQueryValueExA(hKey, BYVAL STRPTR(sValueName), BYVAL %NULL, _
                                      dwRegType, BYVAL STRPTR(sData), dwSize)
             SELECT CASE dwRegType
               CASE %REG_SZ, %REG_EXPAND_SZ, %REG_MULTI_SZ
                 sData = RTRIM$(sData, $NUL) 'Remove one or two ending $NUL
    
               CASE %REG_DWORD
                 sData = FORMAT$(CVDWD(sData)) 'Convert dword to string
    
               CASE %REG_QWORD, %REG_QWORD_LITTLE_ENDIAN
                 sData = FORMAT$(CVQ(sData)) 'Convert quad to string
    
             END SELECT
         END IF
         RegCloseKey(hKey)
     END IF
     FUNCTION = Retval
    
    END FUNCTION
    
    '_________________________________________________________________
    '
    '   SUB  OpenDisplayThread
    '_________________________________________________________________
    
    SUB OpenDisplayThread
      LOCAL idThreadDisplay         AS LONG
    
      THREAD CREATE DisplayThread(1) TO idThreadDisplay
      THREAD CLOSE idThreadDisplay TO idThreadDisplay
    END SUB
    
    
    '_________________________________________________________________
    '
    '   THREAD FUNCTION  DisplayThread
    '_________________________________________________________________
    
    THREAD FUNCTION DisplayThread(BYVAL yyy AS LONG) AS LONG
        LOCAL gravity, temp AS DOUBLE
        LOCAL cnts AS LONG
        LOCAL st AS star PTR
        STATIC slow(), fast(), slw(), fst() AS locator
        LOCAL Result       AS LONG
        LOCAL Done2        AS QUAD
        LOCAL Start2       AS QUAD
    
        GRAPHIC ATTACH ggwin, 0,REDRAW
    
        Result = SetPriorityClass(GetCurrentProcess(), %REALTIME_PRIORITY_CLASS)
        TIX Start2
        'ftmr=TIMER
    
        FOR cntr=1 TO frames
          GRAPHIC CLEAR %BLACK
          circlet (xxx, yyy, r, RGB(45,45,45))
          circlet (xxx, yyy, (r/2), RGB(45,45,45))
          'temp      = uf/(dx*dx+dy*dy+dz*dz)  'calc acceleration of the smallest mass
          'tem1      = temp*@s2.unts        'assign to complete mass of the first of the pair
          'tem2      = -temp*@s1.unts       'assign to complete mass of the second body with opposite direction (-)
          '@s1.velx  = @s1.velx+(tem1)*dx
          '@s1.vely  = @s1.vely+(tem1)*dy
          '@s1.velz  = @s1.velz+(tem1)*dz
          '@s2.velx  = @s2.velx+(tem2)*dx
          '@s2.vely  = @s2.vely+(tem2)*dy
          '@s2.velz  = @s2.velz+(tem2)*dz
        'NEXT cntd
        '@s1.x     = @[email protected]
        '@s1.y     = @[email protected]
        '@s1.z     = @[email protected]
          FOR cnts = 0 TO totalstars
            st=VARPTR(fstr(cnts))
            IF cnts<>totalstars THEN
              temp=uflag/(@st.x*@[email protected]*@[email protected]*@st.y)*@st.allun
              @[email protected]+temp*@st.x
              @[email protected]+temp*@st.z
              @[email protected]+temp*@st.y
              @[email protected][email protected]
              @[email protected][email protected]
              @[email protected][email protected]
            END IF
            IF indic=1 THEN
              IF ABS(@st.velx)+ABS(@st.vely)+ABS(@st.velz)<100550050000000  THEN   '0  35550050000000
                circle ((@st.x*(1/factor)+xxx), (@st.z*(1/factor)+yyy), 1, clrd)
              END IF
            ELSEIF indic=2 THEN
              IF ABS(@st.velx)+ABS(@st.vely)+ABS(@st.velz)<100550050000000  THEN   '0  35550050000000
                circle ((@st.x*(1/factor)+xxx), (@st.z*(1/factor)+yyy), 1, clrd)
              END IF
              'circle (@st.x*(1/factor), @st.z*(1/factor), 1, @st.colr)
              GRAPHIC SET PIXEL (@st.x*(1/factor)+xxx, @st.z*(1/factor)+yyy), @st.colr
            ELSE
              'circle (@st.x*(1/factor), @st.z*(1/factor), (1893404160000000*1), @st.colr)
              GRAPHIC SET PIXEL (@st.x*(1/factor)+xxx, @st.z*(1/factor)+yyy), @st.colr
            END IF
    
          NEXT cnts
          st=VARPTR(fstr(clsst1))
          circle ((@st.x*(1/factor)+xxx),(@st.z*(1/factor)+yyy), 2, %CYAN)
          st=VARPTR(fstr(frthst1))
          circle ((@st.x*(1/factor)+xxx), (@st.z*(1/factor)+yyy), 2, %GREEN)
          GRAPHIC SET POS (-xwyd+10, -yhyt+10)
          'GRAPHIC PRINT "PRIMARY VIEW"
          GRAPHIC PRINT "Frame # "cntr"/" frames '" of " totalstars " stars"
          GRAPHIC PRINT "   Stars : " totalstars
          GRAPHIC SET POS (xwyd-150, -yhyt+1)
          GRAPHIC COLOR RGB(0,0,25), %BLACK
          GRAPHIC PRINT "Copyright 2012, Rodney Hicks"
          GRAPHIC REDRAW
          GRAPHIC COLOR %MAGENTA, %BLACK
          IF ISTRUE shwno THEN         ' s$ = STRINSERT$(MainStr$, NewStr$, position&)
            IF cntr=1 THEN
              imtemp=dattim
              imtemp=STRINSERT$(imtemp,"_",9)
              imtemp="spi_"+imtemp
              'msgbox imtemp
            END IF
          ELSE
            IF ISTRUE shwall THEN
              imtemp=dattim
              imtemp=STRINSERT$(imtemp,"_",9)
              imtemp="spi_"+imtemp
              img=imtemp+"_"+FORMAT$(cntr,"000000")+".BMP"
              GRAPHIC SAVE img
            ELSEIF ISTRUE shwfl AND (cntr=1 OR cntr=frames) THEN
              imtemp=dattim
              imtemp=STRINSERT$(imtemp,"_",9)
              imtemp="spi_"+imtemp
              img=imtemp+"_"+FORMAT$(cntr,"000000")+".BMP"
              GRAPHIC SAVE img
            END IF
          END IF
        NEXT cntr
        TIX Done2
    
        MSGBOX "Elapsed time(sec) :"+ _
               FORMAT$((Done2-Start2)/MyBaseFreq,"###.00") + _
               $CRLF + _
               "Elapsed time(min) :" + _
               FORMAT$((Done2-Start2)/MyBaseFreq/60,"###.00") + _
               $CRLF + _
               "Frames/sec :" + _
               FORMAT$(Frames/((Done2-Start2)/MyBaseFreq),"###.00"), _
               %MB_TASKMODAL
    
        Result = SetPriorityClass(GetCurrentProcess(), %NORMAL_PRIORITY_CLASS)
    
        DIALOG NORMALIZE hDlg
    
    END FUNCTION
    
    '_________________________________________________________________
    '
    ' SUB CLOSE_ACCELERATOR
    '_________________________________________________________________
    
    SUB CLOSE_ACCELERATOR
      'IF gsThisClient = "Server" THEN
          CALL STOP_ACCELERATOR
          MixerClose hMixer
      'END IF
    END SUB
    
    '_________________________________________________________________
    '
    ' SUB STOP_ACCELERATOR
    '_________________________________________________________________
    
    SUB STOP_ACCELERATOR
      'IF gsThisClient = "Server" THEN
          IF gzFileX1 <> "" THEN
              mciSendStringA "close " + $DQ + gzFileX1 + $DQ, "", 0, 0
              gzFileX1 = ""
          END IF
      'END IF
    END SUB
    
    '_________________________________________________________________
    '
    ' SUB START_ACCELERATOR
    '_________________________________________________________________
    
    SUB START_ACCELERATOR   'Lines to excelerate HOMBOT
      'IF gsThisClient = "Server" THEN
          gzFileX1 = EXE.PATH$ + "Silence.mp3"
          gzFileX1 = BetterLongToShort(gzFileX1)
          MciSendStringA("Open " + $DQ + gzFileX1 + $DQ, "", 0, 0)
          MciSendStringA("Play " + $DQ + gzFileX1 + $DQ + " notify", "", 0, hDlg)
      'END IF
    END SUB
    
    '_________________________________________________________________
    '
    ' SUB RESTART_ACCELERATOR
    '_________________________________________________________________
    
    SUB RESTART_ACCELERATOR
      CALL STOP_ACCELERATOR
      CALL START_ACCELERATOR
    END SUB
    
    '_________________________________________________________________
    '
    ' BetterLongToShort
    '_________________________________________________________________
    
    FUNCTION BetterLongToShort(InPath AS STRING) AS STRING
      DIM ShortStr AS ASCIIZ * %MAX_PATH
      DIM LongStr AS ASCIIZ * %MAX_PATH
      DIM NSize&
    
      InPath$ = TRIM$(InPath$)
      DO WHILE LEFT$(InPath$, 1) = CHR$(34) 'QUOTE SYMBOL
      InPath$ = TRIM$(MID$(InPath$, 2))
      LOOP
      DO WHILE RIGHT$(InPath$, 1) = CHR$(34) 'QUOTE SYMBOL
      InPath$ = TRIM$(LEFT$(InPath$, LEN(InPath$) - 1))
      LOOP
    
      NSize& = %MAX_PATH
      LongStr = InPath$
      GetShortPathNameA Longstr, ShortStr, BYVAL NSize&
    
    FUNCTION = ShortStr
    
    END FUNCTION

    Leave a comment:


  • Jim Fritts
    replied
    I made some improvements. Went from 33 fps to 39 fps with the Silence.MP3 implemented. Validation complete. It produced 38.6 fps when covered over by the Edge (Chromium) browser and we know what a hog that is.

    Click image for larger version  Name:	New Bitmap Image.jpg Views:	0 Size:	16.8 KB ID:	796184

    Leave a comment:


  • Jim Fritts
    replied
    David,
    You betcha.

    And I use mciSendStringA to play the MP3.

    Leave a comment:


  • David Roberts
    replied
    Originally posted by Jim
    (in my case it was playing an MP3 file in the background)
    When you do that the timer interval reduces to 1ms from 15.625ms, or whatever.

    Leave a comment:


  • Rodney Hicks
    replied
    Ya forced me into it. Tried TimeSetPriority/TimeEndPriority and got less than a .2 frame/second difference so the OS is now the mitigating or something like that factor.

    Leave a comment:

Working...
X