Files
jak-project/game/graphics/display.h
Hat Kid 1dff571820 game: support splash screens (#4236)
Closes #1496 

This brings back the SCE splash screens. Also adds a runtime flag
`-nosplash` to skip it. Right now, it's on by default, but open to
changes on that (maybe always disable in debug to speed up start times,
etc.).
2026-04-20 03:19:08 +02:00

61 lines
1.6 KiB
C++

#pragma once
/*!
* @file display.h
* Display for graphics. This is the game window, distinct from the runtime console.
*/
#include <memory>
#include <vector>
#include "gfx.h"
#include "common/util/Assert.h"
#include "game/system/hid/display_manager.h"
// 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.
// specific renderers should override this class, the methods are abstract.
class GfxDisplay {
bool m_imgui_visible;
protected:
bool m_main;
public:
virtual ~GfxDisplay() {}
virtual std::shared_ptr<DisplayManager> get_display_manager() const = 0;
virtual std::shared_ptr<InputManager> get_input_manager() const = 0;
virtual void render() = 0;
virtual void init_splash() = 0;
virtual void draw_splash(int fb_w, int fb_h) = 0;
void set_imgui_visible(bool visible) {
m_imgui_visible = visible;
Gfx::g_debug_settings.show_imgui = visible;
}
bool is_imgui_visible() const { return m_imgui_visible; }
};
namespace Display {
// 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;
int InitMainDisplay(int width,
int height,
const char* title,
GfxGlobalSettings& settings,
GameVersion version);
void KillDisplay(std::shared_ptr<GfxDisplay> display);
void KillMainDisplay();
std::shared_ptr<GfxDisplay> GetMainDisplay();
} // namespace Display