summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/04-mesh/mesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/04-mesh/mesh.cpp')
-rw-r--r--3rdparty/bgfx/examples/04-mesh/mesh.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/3rdparty/bgfx/examples/04-mesh/mesh.cpp b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
index 04a36cbaad1..bf4c4269333 100644
--- a/3rdparty/bgfx/examples/04-mesh/mesh.cpp
+++ b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
@@ -27,7 +27,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
, 0
);
- bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
+ bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
// Create program from shaders.
bgfx::ProgramHandle program = loadProgram("vs_mesh", "fs_mesh");
@@ -43,7 +43,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
- bgfx::submit(0);
+ bgfx::touch(0);
int64_t now = bx::getHPCounter();
static int64_t last = now;
@@ -65,7 +65,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view and projection matrix for view 0.
const bgfx::HMD* hmd = bgfx::getHMD();
- if (NULL != hmd)
+ if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
{
float view[16];
bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
@@ -98,11 +98,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bx::mtxRotateXY(mtx
, 0.0f
, time*0.37f
- );
+ );
meshSubmit(mesh, 0, program, mtx);
- // Advance to next frame. Rendering thread will be kicked to
+ // Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}