NOw immediate and object base render can also be swapped with space in the main test GameScene.

This commit is contained in:
Relintai 2024-01-09 12:27:54 +01:00
parent c8b63c2d20
commit 3f4e551a5a
2 changed files with 16 additions and 3 deletions

View File

@ -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,9 +75,12 @@ void GameScene::update(float delta) {
} }
void GameScene::render() { void GameScene::render() {
//render_obj(); if (!immediate) {
render_obj();
} else {
render_immediate(); 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;

View File

@ -32,6 +32,8 @@ public:
GameScene(); GameScene();
~GameScene(); ~GameScene();
bool immediate;
bool left; bool left;
bool right; bool right;
bool up; bool up;