Sha256: 814ab15a3f38599670d756fe566080429d87b6d4edd5a0f529d2892e6a6be8dc

Contents?: true

Size: 463 Bytes

Versions: 34

Compression:

Stored size: 463 Bytes

Contents

#include <Gosu/Inspection.hpp>
#include <Gosu/Timing.hpp>

namespace Gosu
{
    namespace FPS
    {
        int fps, accum, sec;

        void registerFrame()
        {
            ++accum;
            int newSec = Gosu::milliseconds() / 1000;
            if (sec != newSec)
            {
                sec = newSec;
                fps = accum;
                accum = 0;
            }
        }
    }
    
    int fps()
    {
        return FPS::fps;
    }
}

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
gosu-0.8.3 src/Inspection.cpp
gosu-0.8.2 src/Inspection.cpp
gosu-0.8.1 src/Inspection.cpp
gosu-0.8.0 src/Inspection.cpp
gosu-0.8.0.pre7 src/Inspection.cpp
gosu-0.8.0.pre6 src/Inspection.cpp
gosu-0.8.0.pre5 src/Inspection.cpp
gosu-0.8.0.pre4 src/Inspection.cpp
gosu-0.8.0.pre3 GosuImpl/Inspection.cpp
gosu-0.8.0.pre2 GosuImpl/Inspection.cpp
gosu-0.8.0.pre1 GosuImpl/Inspection.cpp
gosu-0.7.50 GosuImpl/Inspection.cpp
gosu-0.7.49 GosuImpl/Inspection.cpp
gosu-0.7.48 GosuImpl/Inspection.cpp
gosu-0.7.47.1 GosuImpl/Inspection.cpp
gosu-0.7.46 GosuImpl/Inspection.cpp
gosu-0.7.45 GosuImpl/Inspection.cpp
gosu-0.7.44 GosuImpl/Inspection.cpp
gosu-0.7.43 GosuImpl/Inspection.cpp
gosu-0.7.41 GosuImpl/Inspection.cpp