Core: Add GBA host interface

This commit is contained in:
Bonta
2021-07-04 13:09:46 +02:00
parent d849d56695
commit 2d744da68c
6 changed files with 41 additions and 0 deletions

View File

@ -3,9 +3,12 @@
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "Common/CommonTypes.h"
// Host - defines an interface for the emulator core to communicate back to the
// OS-specific layer
//
@ -23,6 +26,19 @@
// The host can be just a command line app that opens a window, or a full blown debugger
// interface.
namespace HW::GBA
{
class Core;
} // namespace HW::GBA
class GBAHostInterface
{
public:
virtual ~GBAHostInterface() = default;
virtual void GameChanged() = 0;
virtual void FrameEnded(const std::vector<u32>& video_buffer) = 0;
};
enum class HostMessageID
{
// Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
@ -47,3 +63,5 @@ void Host_UpdateMainFrame();
void Host_UpdateTitle(const std::string& title);
void Host_YieldToUI();
void Host_TitleChanged();
std::unique_ptr<GBAHostInterface> Host_CreateGBAHost(std::weak_ptr<HW::GBA::Core> core);