Panda3DS/include/panda_sdl/frontend_sdl.hpp
Paris Oplopoios 27ad7b01f3
Rename Emulator::run to FrontendSDL::run (#466)
* Rename Emulator::run to FrontendSDL::run

* Update frontend_sdl.cpp

---------

Co-authored-by: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
2024-03-16 23:20:37 +02:00

34 lines
No EOL
902 B
C++

#pragma once
#include <SDL.h>
#include <filesystem>
#include "emulator.hpp"
class FrontendSDL {
Emulator emu;
#ifdef PANDA3DS_ENABLE_OPENGL
SDL_GLContext glContext;
#endif
public:
FrontendSDL();
bool loadROM(const std::filesystem::path& path);
void run();
SDL_Window* window = nullptr;
SDL_GameController* gameController = nullptr;
int gameControllerID;
bool programRunning = true;
// For tracking whether to update gyroscope
// We bind gyro to right click + mouse movement
bool holdingRightClick = false;
// Variables to keep track of whether the user is controlling the 3DS analog stick with their keyboard
// This is done so when a gamepad is connected, we won't automatically override the 3DS analog stick settings with the gamepad's state
// And so the user can still use the keyboard to control the analog
bool keyboardAnalogX = false;
bool keyboardAnalogY = false;
};