ppsspp/UWP/PPSSPP_UWPMain.h

48 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include "thin3d/thin3d.h"
#include "Common/GraphicsContext.h"
#include "Common/DeviceResources.h"
// Renders Direct2D and 3D content on the screen.
namespace UWP {
class UWPGraphicsContext : public GraphicsContext {
public:
UWPGraphicsContext(std::shared_ptr<DX::DeviceResources> resources);
void Shutdown() override;
void SwapInterval(int interval) override;
void SwapBuffers() override {}
void Resize() override {}
Draw::DrawContext * GetDrawContext() override {
return ctx_;
}
private:
Draw::DrawContext *ctx_;
std::shared_ptr<DX::DeviceResources> resources_;
};
class PPSSPP_UWPMain : public DX::IDeviceNotify
{
public:
PPSSPP_UWPMain(const std::shared_ptr<DX::DeviceResources>& deviceResources);
~PPSSPP_UWPMain();
void CreateWindowSizeDependentResources();
void Update();
bool Render();
// IDeviceNotify
virtual void OnDeviceLost();
virtual void OnDeviceRestored();
private:
// Cached pointer to device resources.
std::shared_ptr<DX::DeviceResources> m_deviceResources;
std::unique_ptr<UWPGraphicsContext> m_graphicsContext;
};
}