source-engine/public/panorama/uischeduleddel.h

44 lines
886 B
C
Raw Permalink Normal View History

2020-04-22 16:56:21 +00:00
//=========== Copyright Valve Corporation, All rights reserved. ===============//
//
// Purpose:
//=============================================================================//
#ifndef UISCHEDULEDDEL_H
#define UISCHEDULEDDEL_H
#ifdef _WIN32
#pragma once
#endif
#include "tier1/utldelegate.h"
namespace panorama
{
// Panorama wrapper around CUtlSymbol which always creates symbol in panorama.dll module
class CUIScheduledDel
{
public:
// constructor, destructor
CUIScheduledDel( CUtlDelegate< void() > del );
~CUIScheduledDel();
void Schedule( double flSecondsToRunIn );
void Cancel();
bool BScheduled();
double GetSecondsUntilScheduled() { return MAX( m_flNextScheduled - UIEngine()->GetCurrentFrameTime(), 0.0 ); }
private:
double m_flNextScheduled;
int m_iScheduledIndex;
CUtlDelegate< void() > m_del;
};
} // namespace panorama
#endif // UISCHEDULEDDEL_H