Files
Aerofoil/AerofoilSDL/GpFiber_SDL.h
2020-10-12 00:37:11 -04:00

29 lines
589 B
C++

#pragma once
#include "IGpFiber.h"
#include "SDL_thread.h"
namespace PortabilityLayer
{
class HostSystemServices;
class HostThreadEvent;
}
class GpFiber_SDL final : public IGpFiber
{
public:
explicit GpFiber_SDL(SDL_Thread *thread, PortabilityLayer::HostThreadEvent *threadEvent);
~GpFiber_SDL();
void YieldTo(IGpFiber *fromFiber) override;
void YieldToTerminal(IGpFiber *fromFiber) override;
void Destroy() override;
private:
static int SDLCALL InternalThreadFunction(void *data);
bool m_isDestroying;
PortabilityLayer::HostThreadEvent *m_event;
SDL_Thread *m_thread;
};