77 void paintEvent (Tempest::PaintEvent& event)
override;
78 void resizeEvent (Tempest::SizeEvent & event)
override;
80 void mouseDownEvent (Tempest::MouseEvent& event)
override;
81 void mouseUpEvent (Tempest::MouseEvent& event)
override;
82 void mouseDragEvent (Tempest::MouseEvent& event)
override;
83 void mouseMoveEvent (Tempest::MouseEvent& event)
override;
84 void mouseWheelEvent(Tempest::MouseEvent& event)
override;
86 void keyDownEvent (Tempest::KeyEvent& event)
override;
87 void keyRepeatEvent (Tempest::KeyEvent& event)
override;
88 void keyUpEvent (Tempest::KeyEvent& event)
override;
90 void focusEvent (Tempest::FocusEvent& event)
override;
95 void paintFocus (Tempest::Painter& p,
const Focus& fc,
const Tempest::Matrix4x4& vp);
96 void paintFocus (Tempest::Painter& p, Tempest::Rect rect);
98 void drawBar(Tempest::Painter& p,
const Tempest::Texture2d *bar,
int x,
int y,
float v, Tempest::AlignFlag flg);
99 void drawMsg(Tempest::Painter& p);
100 void drawProgress(Tempest::Painter& p,
int x,
int y,
int w,
int h,
float v);
101 void drawLoading (Tempest::Painter& p,
int x,
int y,
int w,
int h);
102 void drawSaving (Tempest::Painter& p);
103 void drawSaving (Tempest::Painter& p,
const Tempest::Texture2d& back,
int w,
int h,
float scale);
108 void startGame(std::string_view slot);
109 void loadGame (std::string_view slot);
110 void saveGame (std::string_view slot, std::string_view name);
113 void onVideo(std::string_view fname);
114 void onStartLoading();
115 void onWorldLoaded();
116 void onSessionExit();
117 void onBenchmarkFinished();
118 void setGameImpl(std::unique_ptr<GameSession>&& w);
120 void setFullscreen(
bool fs);
122 void processMouse(Tempest::MouseEvent& event,
bool enable);
128 void render()
override;
131 void updateAnimation(uint64_t dt);
132 void tickCamera(uint64_t dt);
133 void isDialogClosed(
bool& ret);
135 template<Tempest::KeyEvent::KeyType k>
143 enum RuntimeMode : uint8_t {
149 Tempest::Device& device;
150 Tempest::Swapchain swapchain;
151 Tempest::TextureAtlas atlas;
155 Tempest::VectorImage uiLayer, numOverlay;
163 Tempest::Texture2d background;
164 const Tempest::Texture2d* loadBox=
nullptr;
165 const Tempest::Texture2d* loadVal=
nullptr;
167 const Tempest::Texture2d* barBack=
nullptr;
168 const Tempest::Texture2d* barHp =
nullptr;
169 const Tempest::Texture2d* barMisc=
nullptr;
170 const Tempest::Texture2d* barMana=
nullptr;
172 const Tempest::Texture2d* focusImg=
nullptr;
174 const Tempest::Texture2d* saveback=
nullptr;
176 bool mouseP[Tempest::MouseEvent::ButtonBack]={};
187#if defined(__MOBILE_PLATFORM__)
190 RuntimeMode runtimeMode = R_Normal;
192 Tempest::Widget* uiKeyUp=
nullptr;
193 Tempest::Point dMouse;
197 Tempest::Shortcut funcKey[11];
198 Tempest::Shortcut displayPos;
203 struct BenchmarkData {
204 std::vector<uint64_t> low1procent;
205 size_t numFrames = 0;
207 void push(uint64_t t);
217 void push(uint64_t t);
221 BenchmarkData benchmark;
222 uint64_t maxFpsInv = 0;
Main application window handling game rendering and input.
float uiScale() const
Returns the current UI scaling factor.