2023-07-31 07:27:01 +00:00
|
|
|
#include "screen_test.h"
|
|
|
|
|
|
|
|
// standard library includes
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
// third party includes
|
|
|
|
#include <raylib.h>
|
|
|
|
|
|
|
|
TestScreen::TestScreen(ScreenStack::Weak weak_ptr)
|
|
|
|
: Screen(weak_ptr), TEMP_cached_dt(0.0F) {}
|
|
|
|
TestScreen::~TestScreen() {}
|
|
|
|
|
2023-08-23 07:37:26 +00:00
|
|
|
bool TestScreen::update(float dt, bool) {
|
2023-07-31 07:27:01 +00:00
|
|
|
TEMP_cached_dt = dt;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-08-23 07:37:26 +00:00
|
|
|
bool TestScreen::draw(RenderTexture *render_texture) {
|
2023-07-31 07:27:01 +00:00
|
|
|
std::string dt_string =
|
|
|
|
std::string("Delta-time: ") + std::to_string(TEMP_cached_dt);
|
|
|
|
|
2023-08-23 07:37:26 +00:00
|
|
|
BeginTextureMode(*render_texture);
|
2023-07-31 07:27:01 +00:00
|
|
|
ClearBackground(BLACK);
|
|
|
|
DrawText("Testing...", 100, 100, 30, RAYWHITE);
|
|
|
|
DrawText(dt_string.c_str(), 100, 140, 30, RAYWHITE);
|
2023-08-23 07:37:26 +00:00
|
|
|
EndTextureMode();
|
2023-07-31 07:27:01 +00:00
|
|
|
return false;
|
|
|
|
}
|