diff options
Diffstat (limited to '3rdparty/bgfx/examples/34-mvs/mvs.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/34-mvs/mvs.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/3rdparty/bgfx/examples/34-mvs/mvs.cpp b/3rdparty/bgfx/examples/34-mvs/mvs.cpp index 87144356f8f..731a08f1bbc 100644 --- a/3rdparty/bgfx/examples/34-mvs/mvs.cpp +++ b/3rdparty/bgfx/examples/34-mvs/mvs.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" @@ -18,16 +18,16 @@ struct PosVertex static void init() { - ms_decl + ms_layout .begin() .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float) .end(); }; - static bgfx::VertexDecl ms_decl; + static bgfx::VertexLayout ms_layout; }; -bgfx::VertexDecl PosVertex::ms_decl; +bgfx::VertexLayout PosVertex::ms_layout; struct ColorVertex { @@ -35,16 +35,16 @@ struct ColorVertex static void init() { - ms_decl + ms_layout .begin() .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true) .end(); }; - static bgfx::VertexDecl ms_decl; + static bgfx::VertexLayout ms_layout; }; -bgfx::VertexDecl ColorVertex::ms_decl; +bgfx::VertexLayout ColorVertex::ms_layout; static PosVertex s_cubePosVertices[] = { @@ -105,8 +105,8 @@ static const uint16_t s_cubeTriStrip[] = class ExampleMvs : public entry::AppI { public: - ExampleMvs(const char* _name, const char* _description) - : entry::AppI(_name, _description) + ExampleMvs(const char* _name, const char* _description, const char* _url) + : entry::AppI(_name, _description, _url) { } @@ -124,6 +124,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; @@ -148,13 +151,13 @@ public: m_vbh[0] = bgfx::createVertexBuffer( // Static data can be passed with bgfx::makeRef bgfx::makeRef(s_cubePosVertices, sizeof(s_cubePosVertices) ) - , PosVertex::ms_decl + , PosVertex::ms_layout ); m_vbh[1] = bgfx::createVertexBuffer( // Static data can be passed with bgfx::makeRef bgfx::makeRef(s_cubeColorVertices, sizeof(s_cubeColorVertices) ) - , ColorVertex::ms_decl + , ColorVertex::ms_layout ); // Create static index buffer. @@ -281,4 +284,9 @@ public: } // namespace -ENTRY_IMPLEMENT_MAIN(ExampleMvs, "34-mvs", "Multiple vertex streams."); +ENTRY_IMPLEMENT_MAIN( + ExampleMvs + , "34-mvs" + , "Multiple vertex streams." + , "https://bkaradzic.github.io/bgfx/examples.html#mvs" + ); |