Sistema de notificacions amb presets (F4, llisca des de dalt) (v0.9.0)
This commit is contained in:
1 parent
96cbdf96b6
commit
1b430500f4
10 files changed
+208
-10
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include "core/rendering/notifier.hpp"
|
||||
#include "core/rendering/render_info.hpp"
|
||||
#include "core/rendering/screen.hpp"
|
||||
#include "core/resources/resource_cache.hpp"
|
||||
@@ -35,17 +36,20 @@ void GameScene::update(int delta_ms) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN) {
|
||||
if (event.key.scancode == SDL_SCANCODE_ESCAPE) { wants_quit_ = true; }
|
||||
if (event.key.scancode == SDL_SCANCODE_F3) { RenderInfo::get().toggle(); }
|
||||
if (event.key.scancode == SDL_SCANCODE_F4) { Notifier::get().notify("notificacio de prova"); }
|
||||
}
|
||||
}
|
||||
|
||||
const float DT = static_cast<float>(delta_ms) / 1000.0F;
|
||||
for (auto& player : players_) { player->update(DT); }
|
||||
RenderInfo::get().update(delta_ms);
|
||||
Notifier::get().update(delta_ms);
|
||||
}
|
||||
|
||||
void GameScene::render() {
|
||||
Screen::get().clear(0x00, 0x00, 0x00);
|
||||
for (auto& player : players_) { player->render(); }
|
||||
Notifier::get().render();
|
||||
RenderInfo::get().render();
|
||||
Screen::get().present();
|
||||
}
|
||||
Reference in new issue
Block a user