summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
diff options
context:
space:
mode:
author Julian Sikorski <belegdol+github@gmail.com>2023-09-05 17:10:24 +0200
committer GitHub <noreply@github.com>2023-09-06 01:10:24 +1000
commit1c61ccfe840cdae7a9f92292946a45f3b47e2412 (patch)
treeb56d4b69b96e314abcf56407da44705a602727f1 /3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
parentb2c399c61d65063ae95e8387d34b098e9516b1a9 (diff)
Updated bgfx, bx and bimg to current upstream versions. (#11493)
* Reverted "macOS, iOS: Removed OpenGL/OpenGLES support. (commit 4693983242a698eaafed87faf4ffef1789adc8f9). * Reverted "Fix macOS build" (commit ce2c2c13eda7d699051f75f598e740a447343a88). * Reverted "macOS: Fixed deprecated warnings." (commit 10a8cb61f882ebc9bb376ee2341d003880b7037f). * Added bgfx/README.mame explaining deviations from upstream.
Diffstat (limited to '3rdparty/bgfx/examples/00-helloworld/helloworld.cpp')
-rw-r--r--3rdparty/bgfx/examples/00-helloworld/helloworld.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
index 97a79463357..8b989195207 100644
--- a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
+++ b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2023 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -34,6 +34,7 @@ public:
init.vendorId = args.m_pciId;
init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle);
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -90,9 +91,12 @@ public:
// Use debug font to print information about this example.
bgfx::dbgTextClear();
+
+ const bgfx::Stats* stats = bgfx::getStats();
+
bgfx::dbgTextImage(
- bx::max<uint16_t>(uint16_t(m_width /2/8 ), 20)-20
- , bx::max<uint16_t>(uint16_t(m_height/2/16), 6)-6
+ bx::max<uint16_t>(uint16_t(stats->textWidth/2), 20)-20
+ , bx::max<uint16_t>(uint16_t(stats->textHeight/2), 6)-6
, 40
, 12
, s_logo
@@ -103,7 +107,6 @@ public:
bgfx::dbgTextPrintf(80, 1, 0x0f, "\x1b[;0m \x1b[;1m \x1b[; 2m \x1b[; 3m \x1b[; 4m \x1b[; 5m \x1b[; 6m \x1b[; 7m \x1b[0m");
bgfx::dbgTextPrintf(80, 2, 0x0f, "\x1b[;8m \x1b[;9m \x1b[;10m \x1b[;11m \x1b[;12m \x1b[;13m \x1b[;14m \x1b[;15m \x1b[0m");
- const bgfx::Stats* stats = bgfx::getStats();
bgfx::dbgTextPrintf(0, 2, 0x0f, "Backbuffer %dW x %dH in pixels, debug text %dW x %dH in characters."
, stats->width
, stats->height