2021-02-06 16:55:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "frontends/sdl/sdlframe.h"
|
2021-03-06 17:41:32 +00:00
|
|
|
#include "frontends/sdl/imgui/sdlsettings.h"
|
2021-02-06 16:55:08 +00:00
|
|
|
#include "frontends/sdl/imgui/gles.h"
|
|
|
|
|
2021-02-25 16:04:50 +00:00
|
|
|
namespace common2
|
|
|
|
{
|
2021-05-29 21:50:33 +01:00
|
|
|
struct EmulatorOptions;
|
2021-02-25 16:04:50 +00:00
|
|
|
}
|
2021-02-09 16:02:36 +00:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
namespace sa2
|
2021-02-06 16:55:08 +00:00
|
|
|
{
|
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
class SDLImGuiFrame : public SDLFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SDLImGuiFrame(const common2::EmulatorOptions & options);
|
2021-02-06 16:55:08 +00:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
~SDLImGuiFrame() override;
|
2021-02-06 16:55:08 +00:00
|
|
|
|
2021-06-07 18:34:17 +01:00
|
|
|
void VideoPresentScreen() override;
|
2021-05-26 17:48:44 +01:00
|
|
|
void ResetSpeed() override;
|
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
protected:
|
2021-02-23 19:32:00 +00:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
void ProcessSingleEvent(const SDL_Event & event, bool & quit) override;
|
2021-06-05 13:51:07 +01:00
|
|
|
void GetRelativeMousePosition(const SDL_MouseMotionEvent & motion, double & x, double & y) const override;
|
2021-02-07 16:10:54 +00:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
private:
|
2021-02-07 16:10:54 +00:00
|
|
|
|
2021-06-07 18:34:17 +01:00
|
|
|
void UpdateTexture();
|
2021-02-25 16:31:24 +00:00
|
|
|
void ClearBackground();
|
|
|
|
void DrawAppleVideo();
|
2021-02-07 16:10:54 +00:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
size_t myPitch;
|
|
|
|
size_t myOffset;
|
|
|
|
size_t myBorderlessWidth;
|
|
|
|
size_t myBorderlessHeight;
|
2021-02-06 16:55:08 +00:00
|
|
|
|
2021-06-05 14:25:32 +01:00
|
|
|
int myDeadTopZone; // for mouse position
|
2021-06-05 13:51:07 +01:00
|
|
|
|
2021-02-25 16:31:24 +00:00
|
|
|
SDL_GLContext myGLContext;
|
|
|
|
ImTextureID myTexture;
|
2021-02-07 16:10:54 +00:00
|
|
|
|
2021-03-06 17:41:32 +00:00
|
|
|
std::string myIniFileLocation;
|
2021-02-25 16:31:24 +00:00
|
|
|
ImGuiSettings mySettings;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|