diff options
author | 2015-10-20 21:34:36 +0200 | |
---|---|---|
committer | 2015-10-20 21:34:36 +0200 | |
commit | a7b8acbe3eebcf17367baa642375cfa47ae4ea85 (patch) | |
tree | 854b859d6176802c0278f4b00de3f7c774e02dda /3rdparty/bgfx/examples/04-mesh/mesh.cpp | |
parent | 4610935e796661874bb4ee7ec6536d9423aeb7be (diff) | |
parent | 74aae76c4e3e257f99d139c4febb5d86d1419e50 (diff) |
Merge pull request #6 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/bgfx/examples/04-mesh/mesh.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/04-mesh/mesh.cpp | 10 |
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(); } |