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;
|
right = pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (k->get_physical_scancode() == KEY_SPACE) {
|
||||||
|
if (pressed) {
|
||||||
|
immediate = !immediate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,8 +75,11 @@ void GameScene::update(float delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::render() {
|
void GameScene::render() {
|
||||||
//render_obj();
|
if (!immediate) {
|
||||||
render_immediate();
|
render_obj();
|
||||||
|
} else {
|
||||||
|
render_immediate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void GameScene::render_immediate() {
|
void GameScene::render_immediate() {
|
||||||
Renderer *r = Renderer::get_singleton();
|
Renderer *r = Renderer::get_singleton();
|
||||||
@ -157,6 +166,8 @@ void GameScene::render_obj() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GameScene::GameScene() {
|
GameScene::GameScene() {
|
||||||
|
immediate = false;
|
||||||
|
|
||||||
left = false;
|
left = false;
|
||||||
right = false;
|
right = false;
|
||||||
up = false;
|
up = false;
|
||||||
|
@ -32,6 +32,8 @@ public:
|
|||||||
GameScene();
|
GameScene();
|
||||||
~GameScene();
|
~GameScene();
|
||||||
|
|
||||||
|
bool immediate;
|
||||||
|
|
||||||
bool left;
|
bool left;
|
||||||
bool right;
|
bool right;
|
||||||
bool up;
|
bool up;
|
||||||
@ -63,4 +65,4 @@ public:
|
|||||||
//ColoredMaterial *cmaterial;
|
//ColoredMaterial *cmaterial;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user