ja tenim algo de gamecontext. lo proxim va a ser fer algo per a la gestió del temps
This commit is contained in:
1 parent
9b168f02eb
commit
ffc2dee311
7 files changed
+52
-6
No files matched your search
@@ -1,16 +1,22 @@
|
||||
// test.cpp
|
||||
|
||||
#include "test.hpp"
|
||||
#include "core/rendering/video.hpp"
|
||||
#include "game/gamecontext.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
Test::Test(GameContext& context)
|
||||
: context_(context) {}
|
||||
|
||||
auto Test::update() -> Scenes {
|
||||
static int count = 0;
|
||||
std::cout << count++ << "\n";
|
||||
if (count == 100) { return Scenes::QUIT; }
|
||||
if (count == 500) { return Scenes::QUIT; }
|
||||
return Scenes::CONTINUE;
|
||||
}
|
||||
|
||||
void Test::render() {
|
||||
context_.video->clean(0xAA0000);
|
||||
context_.video->present();
|
||||
}
|
||||
@@ -4,8 +4,14 @@
|
||||
|
||||
#include "scene.hpp"
|
||||
|
||||
struct GameContext;
|
||||
|
||||
class Test final : public Scene {
|
||||
public:
|
||||
explicit Test(GameContext& context);
|
||||
auto update() -> Scenes override;
|
||||
void render() override;
|
||||
|
||||
private:
|
||||
GameContext& context_;
|
||||
};
|
||||
Reference in new issue
Block a user