AppleWin/source/linux/context.cpp
Andrea Odetti 11c44233b4 Revisit initialisation to drive it all from the FrameBase.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2021-03-27 18:48:05 +00:00

46 lines
744 B
C++

#include "StdAfx.h"
#include "linux/context.h"
#include "Interface.h"
#include "linux/duplicates/PropertySheet.h"
#include "linux/linuxframe.h"
namespace
{
std::shared_ptr<FrameBase> sg_LinuxFrame;
}
IPropertySheet& GetPropertySheet()
{
static CPropertySheet sg_PropertySheet;
return sg_PropertySheet;
}
FrameBase& GetFrame()
{
return *sg_LinuxFrame;
}
void SetFrame(const std::shared_ptr<FrameBase> & frame)
{
sg_LinuxFrame = frame;
}
Video& GetVideo()
{
static Video sg_Video;
return sg_Video;
}
Initialisation::Initialisation(const std::shared_ptr<FrameBase> & frame)
{
SetFrame(frame);
frame->Initialize();
}
Initialisation::~Initialisation()
{
GetFrame().Destroy();
SetFrame(std::shared_ptr<FrameBase>());
}