Formula una domandaFormula una domanda
 

Con rispostaHow to get FPS?

Risposte

  • mercoledì 4 novembre 2009 21.20P.Brian.Mackey Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    We can only assume that what you ask is what you need help with.  Now that you have showed you have made an effort, we can guide you further.  Let's start with the code you posted.  Environment.Tickcount "Gets the number of milliseconds elapsed since the system started. "  This is not what you seek.  So that post can be tossed aside.  Next, we note that FPS is a GPU counter.  As far as I am aware there is no builtin GPU performance monitoring in windows.  So, you can go to a website like the nvidia developer site in order to start moving in the correct direction.


    Good coding involves knowing one's logical limits and expanding them as necessary.

Tutte le risposte

  • mercoledì 4 novembre 2009 20.39P.Brian.Mackey Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Start by trying.
    Good coding involves knowing one's logical limits and expanding them as necessary.
  • mercoledì 4 novembre 2009 21.02matanc1 Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Contiene codice
    Wow that's really fair considering the fact that you don't know what I've done.....
    But I HAVE looked it up on google, found code for it:

        public class Utility
        {
            #region Basic Frame Counter
    
            private static int lastTick;
            private static int lastFrameRate;
            private static int frameRate;
    
            public static int CalculateFrameRate()
            {
                if (System.Environment.TickCount - lastTick >= 1000)
                {
                    lastFrameRate = frameRate;
                    frameRate = 0;
                    lastTick = System.Environment.TickCount;
                }
                frameRate++;
                return lastFrameRate;
            }
            #endregion
    
        }
    This code always seemed to return the number 2.
    I'm just an amateur which is why I'm seeking your professional help.
    Thank you!

  • mercoledì 4 novembre 2009 21.20P.Brian.Mackey Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta

    We can only assume that what you ask is what you need help with.  Now that you have showed you have made an effort, we can guide you further.  Let's start with the code you posted.  Environment.Tickcount "Gets the number of milliseconds elapsed since the system started. "  This is not what you seek.  So that post can be tossed aside.  Next, we note that FPS is a GPU counter.  As far as I am aware there is no builtin GPU performance monitoring in windows.  So, you can go to a website like the nvidia developer site in order to start moving in the correct direction.


    Good coding involves knowing one's logical limits and expanding them as necessary.