1
0
mirror of https://github.com/solemnwarning/directplay-lite synced 2024-12-30 16:45:37 +01:00
directplay-lite/src/EventObject.cpp

25 lines
425 B
C++

#include <winsock2.h>
#include <windows.h>
#include <stdexcept>
#include "EventObject.hpp"
EventObject::EventObject(BOOL bManualReset, BOOL bInitialState)
{
handle = CreateEvent(NULL, bManualReset, bInitialState, NULL);
if(handle == NULL)
{
throw std::runtime_error("Unable to create event object");
}
}
EventObject::~EventObject()
{
CloseHandle(handle);
}
EventObject::operator HANDLE() const
{
return handle;
}