mirror of
https://github.com/Relintai/sfw.git
synced 2024-11-08 07:52:09 +01:00
NOw immediate and object base render can also be swapped with space in the main test GameScene.
This commit is contained in:
parent
c8b63c2d20
commit
3f4e551a5a
@ -32,6 +32,12 @@ void GameScene::input_event(const Ref<InputEvent> &event) {
|
||||
right = pressed;
|
||||
}
|
||||
|
||||
if (k->get_physical_scancode() == KEY_SPACE) {
|
||||
if (pressed) {
|
||||
immediate = !immediate;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -69,9 +75,12 @@ void GameScene::update(float delta) {
|
||||
}
|
||||
|
||||
void GameScene::render() {
|
||||
//render_obj();
|
||||
if (!immediate) {
|
||||
render_obj();
|
||||
} else {
|
||||
render_immediate();
|
||||
}
|
||||
}
|
||||
void GameScene::render_immediate() {
|
||||
Renderer *r = Renderer::get_singleton();
|
||||
|
||||
@ -157,6 +166,8 @@ void GameScene::render_obj() {
|
||||
}
|
||||
|
||||
GameScene::GameScene() {
|
||||
immediate = false;
|
||||
|
||||
left = false;
|
||||
right = false;
|
||||
up = false;
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
GameScene();
|
||||
~GameScene();
|
||||
|
||||
bool immediate;
|
||||
|
||||
bool left;
|
||||
bool right;
|
||||
bool up;
|
||||
|
Loading…
Reference in New Issue
Block a user