2021-03-09 23:51:28 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* @file display.h
|
|
|
|
* Display for graphics. This is the game window, distinct from the runtime console.
|
|
|
|
*/
|
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
#include <memory>
|
2022-06-22 23:37:46 -04:00
|
|
|
#include <vector>
|
|
|
|
|
2022-06-16 22:46:12 -04:00
|
|
|
#include "gfx.h"
|
|
|
|
|
2022-06-22 23:37:46 -04:00
|
|
|
#include "common/util/Assert.h"
|
|
|
|
|
2023-06-04 15:34:37 -04:00
|
|
|
#include "game/system/hid/display_manager.h"
|
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
// a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal
|
|
|
|
// window pointer used by whichever renderer. It also contains functions for setting and
|
|
|
|
// retrieving certain window parameters.
|
2022-08-06 11:57:19 -04:00
|
|
|
// specific renderers should override this class, the methods are abstract.
|
2021-08-09 19:16:39 -04:00
|
|
|
class GfxDisplay {
|
2022-06-17 19:39:33 -04:00
|
|
|
bool m_imgui_visible;
|
2021-12-30 18:48:37 -05:00
|
|
|
|
2022-06-16 22:46:12 -04:00
|
|
|
protected:
|
|
|
|
bool m_main;
|
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
public:
|
2022-06-16 22:46:12 -04:00
|
|
|
virtual ~GfxDisplay() {}
|
|
|
|
|
2023-06-04 15:34:37 -04:00
|
|
|
virtual std::shared_ptr<DisplayManager> get_display_manager() const = 0;
|
|
|
|
virtual std::shared_ptr<InputManager> get_input_manager() const = 0;
|
2022-07-31 13:31:17 -04:00
|
|
|
|
2023-06-04 15:34:37 -04:00
|
|
|
virtual void render() = 0;
|
2022-08-06 11:57:19 -04:00
|
|
|
|
2023-01-02 09:45:38 -05:00
|
|
|
void set_imgui_visible(bool visible) {
|
|
|
|
m_imgui_visible = visible;
|
|
|
|
Gfx::g_debug_settings.show_imgui = visible;
|
|
|
|
}
|
2022-06-17 19:39:33 -04:00
|
|
|
bool is_imgui_visible() const { return m_imgui_visible; }
|
2021-08-09 19:16:39 -04:00
|
|
|
};
|
2021-03-09 23:51:28 -05:00
|
|
|
|
|
|
|
namespace Display {
|
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
// a list of displays. the first one is the "main" display, all others are spectator-like extra
|
|
|
|
// views.
|
|
|
|
extern std::vector<std::shared_ptr<GfxDisplay>> g_displays;
|
2021-03-09 23:51:28 -05:00
|
|
|
|
2022-06-30 21:11:58 -04:00
|
|
|
int InitMainDisplay(int width,
|
|
|
|
int height,
|
|
|
|
const char* title,
|
2023-06-04 15:34:37 -04:00
|
|
|
GfxGlobalSettings& settings,
|
2022-06-30 21:11:58 -04:00
|
|
|
GameVersion version);
|
2021-08-09 19:16:39 -04:00
|
|
|
void KillDisplay(std::shared_ptr<GfxDisplay> display);
|
2021-08-13 20:06:16 -04:00
|
|
|
void KillMainDisplay();
|
2021-03-09 23:51:28 -05:00
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
std::shared_ptr<GfxDisplay> GetMainDisplay();
|
2021-03-09 23:51:28 -05:00
|
|
|
|
2021-08-09 19:16:39 -04:00
|
|
|
} // namespace Display
|