summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/07-callback
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/07-callback')
-rw-r--r--3rdparty/bgfx/examples/07-callback/callback.cpp29
-rw-r--r--3rdparty/bgfx/examples/07-callback/fs_callback.sc4
-rw-r--r--3rdparty/bgfx/examples/07-callback/makefile4
-rw-r--r--3rdparty/bgfx/examples/07-callback/vs_callback.sc4
4 files changed, 25 insertions, 16 deletions
diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp
index 987c51761ac..04b098a56c5 100644
--- a/3rdparty/bgfx/examples/07-callback/callback.cpp
+++ b/3rdparty/bgfx/examples/07-callback/callback.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -29,17 +29,17 @@ struct PosColorVertex
static void init()
{
- ms_decl
+ ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
.end();
};
- static bgfx::VertexDecl ms_decl;
+ static bgfx::VertexLayout ms_layout;
};
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_layout;
static PosColorVertex s_cubeVertices[8] =
{
@@ -279,8 +279,9 @@ public:
if (kNaturalAlignment >= _align)
{
+ intptr_t _ptrOld = intptr_t(_ptr);
void* ptr = ::realloc(_ptr, _size);
- bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file, _line, ptr, _ptr, _size);
+ bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file, _line, ptr, _ptrOld, _size);
if (NULL == _ptr)
{
@@ -307,8 +308,8 @@ private:
class ExampleCallback : public entry::AppI
{
public:
- ExampleCallback(const char* _name, const char* _description)
- : entry::AppI(_name, _description)
+ ExampleCallback(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
{
}
@@ -328,6 +329,9 @@ public:
bgfx::Init init;
init.type = args.m_type;
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;
@@ -352,7 +356,7 @@ public:
// Create static vertex buffer.
m_vbh = bgfx::createVertexBuffer(
bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
- , PosColorVertex::ms_decl
+ , PosColorVertex::ms_layout
);
// Create static index buffer.
@@ -498,4 +502,9 @@ public:
} // namespace
-ENTRY_IMPLEMENT_MAIN(ExampleCallback, "07-callback", "Implementing application specific callbacks for taking screen shots, caching OpenGL binary shaders, and video capture.");
+ENTRY_IMPLEMENT_MAIN(
+ ExampleCallback
+ , "07-callback"
+ , "Implementing application specific callbacks for taking screen shots, caching OpenGL binary shaders, and video capture."
+ , "https://bkaradzic.github.io/bgfx/examples.html#callback"
+ );
diff --git a/3rdparty/bgfx/examples/07-callback/fs_callback.sc b/3rdparty/bgfx/examples/07-callback/fs_callback.sc
index f9808c77f3b..3e8f850e34a 100644
--- a/3rdparty/bgfx/examples/07-callback/fs_callback.sc
+++ b/3rdparty/bgfx/examples/07-callback/fs_callback.sc
@@ -1,8 +1,8 @@
$input v_world, v_color0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/07-callback/makefile b/3rdparty/bgfx/examples/07-callback/makefile
index 171709170a4..19c81e43692 100644
--- a/3rdparty/bgfx/examples/07-callback/makefile
+++ b/3rdparty/bgfx/examples/07-callback/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2018 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/07-callback/vs_callback.sc b/3rdparty/bgfx/examples/07-callback/vs_callback.sc
index 28ef12e9083..aba775fd4eb 100644
--- a/3rdparty/bgfx/examples/07-callback/vs_callback.sc
+++ b/3rdparty/bgfx/examples/07-callback/vs_callback.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_world, v_color0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"