Added ANSI escape codes for debug text. Added info about backbuffer and debug text width/height.

This commit is contained in:
Branimir Karadžić
2016-11-28 21:00:57 -08:00
parent 88ba04a4c9
commit 0e933091ed
6 changed files with 103 additions and 19 deletions

View File

@@ -65,6 +65,16 @@ class ExampleHelloWorld : public entry::AppI
bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/00-helloworld");
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Initialization and debug text.");
bgfx::dbgTextPrintf(0, 4, 0x0f, "Color can be changed with ANSI \e[9;me\e[10;ms\e[11;mc\e[12;ma\e[13;mp\e[14;me\e[0m code too.");
const bgfx::Stats* stats = bgfx::getStats();
bgfx::dbgTextPrintf(0, 6, 0x0f, "Backbuffer %dW x %dH in pixels, debug text %dW x %dH in characters."
, stats->width
, stats->height
, stats->textWidth
, stats->textHeight
);
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();