#pragma once #include #include class z80viewer; struct viewer_t { char name[12]; z80viewer *viewer; }; class z80viewer { public: virtual void show() = 0; virtual void refresh() = 0; virtual void hide() = 0; virtual void focus() = 0; virtual bool handleEvent(SDL_Event *e) = 0; static void registerViewer(const char *name, z80viewer *viewer); static z80viewer *getViewer(const char *name); static void refreshAll(); static bool handleEvents(SDL_Event *e); protected: SDL_Window *win = nullptr; SDL_Renderer *ren = nullptr; SDL_Texture *tex = nullptr; SDL_Texture *uitex = nullptr; static std::vector viewers; };