Sha256: d125e463772a3fe406d402f2d9462520d57db06fa96658caf5b52fddca6471fb

Contents?: true

Size: 475 Bytes

Versions: 11

Compression:

Stored size: 475 Bytes

Contents

#include <Gosu/Timing.hpp>
#include <windows.h>
#include <cstdlib>

void Gosu::sleep(unsigned milliseconds)
{
    ::Sleep(milliseconds);
}

namespace
{
    void resetTGT()
    {
        ::timeEndPeriod(1);
    }
}

unsigned long Gosu::milliseconds()
{
    static bool init = false;
    if (!init)
    {
        if (::timeBeginPeriod(1) != TIMERR_NOERROR)
            std::atexit(resetTGT);
        init = true;
    }
    return ::timeGetTime();
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gosu-0.7.16 GosuImpl/TimingWin.cpp
gosu-0.7.15 GosuImpl/TimingWin.cpp
gosu-0.7.14 GosuImpl/TimingWin.cpp
gosu-0.7.10.1 GosuImpl/TimingWin.cpp
gosu-0.7.10.2 GosuImpl/TimingWin.cpp
gosu-0.7.10.3 GosuImpl/TimingWin.cpp
gosu-0.7.11 GosuImpl/TimingWin.cpp
gosu-0.7.12 GosuImpl/TimingWin.cpp
gosu-0.7.13.3 GosuImpl/TimingWin.cpp
gosu-0.7.13.2 GosuImpl/TimingWin.cpp
gosu-0.7.13 GosuImpl/TimingWin.cpp