AppleWin/source/frontends/sdl/imgui/sdlimguiframe.h
Andrea Odetti c81b4ab1bf ImGui: fix event handling.
1) always pass events to ImGui
2) only pass keyboards to AW when ImGui says so
2021-02-23 19:32:00 +00:00

47 lines
874 B
C++

#pragma once
#include "frontends/sdl/sdlframe.h"
#include "frontends/sdl/imgui/gles.h"
class EmulatorOptions;
class SDLImGuiFrame : public SDLFrame
{
public:
SDLImGuiFrame(const EmulatorOptions & options);
~SDLImGuiFrame() override;
void UpdateTexture() override;
void RenderPresent() override;
protected:
void ProcessSingleEvent(const SDL_Event & event, bool & quit) override;
private:
void ClearBackground();
void DrawAppleVideo();
void ShowSettings();
struct ImGuiSettings
{
std::string iniFileLocation;
bool windowed = false;
bool showDemo = false;
bool showSettings = false;
int speakerVolume = 50;
int mockingboardVolume = 50;
};
size_t myPitch;
size_t myOffset;
size_t myBorderlessWidth;
size_t myBorderlessHeight;
SDL_GLContext myGLContext;
ImTextureID myTexture;
ImGuiSettings mySettings;
};