summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/04-mesh/mesh.cpp
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-12-05 19:45:08 +0100
committer mooglyguy <therealmogminer@gmail.com>2018-12-05 19:45:08 +0100
commit0bd02131b644b61088789f52f31b750c9aecaa6d (patch)
tree811c679a1bba8b24fc7967cdfe73640254d64156 /3rdparty/bgfx/examples/04-mesh/mesh.cpp
parent9a81ec7eaf00d73a23db5c003dc45b55d4b76c4a (diff)
3rdparty: Updated bgfx, bimg, and bx to latest upstream. [Ryan Holtz]
Diffstat (limited to '3rdparty/bgfx/examples/04-mesh/mesh.cpp')
-rw-r--r--3rdparty/bgfx/examples/04-mesh/mesh.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/3rdparty/bgfx/examples/04-mesh/mesh.cpp b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
index 2b2e2f2cea7..06896ef0208 100644
--- a/3rdparty/bgfx/examples/04-mesh/mesh.cpp
+++ b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2017 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -27,8 +27,13 @@ public:
m_debug = BGFX_DEBUG_NONE;
m_reset = BGFX_RESET_VSYNC;
- bgfx::init(args.m_type, args.m_pciId);
- bgfx::reset(m_width, m_height, m_reset);
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
// Enable debug text.
bgfx::setDebug(m_debug);
@@ -98,24 +103,10 @@ public:
float time = (float)( (bx::getHPCounter()-m_timeOffset)/double(bx::getHPFrequency() ) );
bgfx::setUniform(u_time, &time);
- float at[3] = { 0.0f, 1.0f, 0.0f };
- float eye[3] = { 0.0f, 1.0f, -2.5f };
+ const bx::Vec3 at = { 0.0f, 1.0f, 0.0f };
+ const bx::Vec3 eye = { 0.0f, 1.0f, -2.5f };
// Set view and projection matrix for view 0.
- const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
- {
- float view[16];
- bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
- bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
-
- // Set view 0 default viewport.
- //
- // Use HMD's width/height since HMD's internal frame buffer size
- // might be much larger than window size.
- bgfx::setViewRect(0, 0, 0, hmd->width, hmd->height);
- }
- else
{
float view[16];
bx::mtxLookAt(view, eye, at);