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/05-instancing/instancing.cpp | |
parent | 4610935e796661874bb4ee7ec6536d9423aeb7be (diff) | |
parent | 74aae76c4e3e257f99d139c4febb5d86d1419e50 (diff) |
Merge pull request #6 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/bgfx/examples/05-instancing/instancing.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/05-instancing/instancing.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp index bac9b68547f..2313adccabd 100644 --- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp +++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp @@ -104,7 +104,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; @@ -135,7 +135,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); @@ -191,9 +191,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) } } - // Set vertex and fragment shaders. - bgfx::setProgram(program); - // Set vertex and index buffer. bgfx::setVertexBuffer(vbh); bgfx::setIndexBuffer(ibh); @@ -205,7 +202,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setState(BGFX_STATE_DEFAULT); // Submit primitive for rendering to view 0. - bgfx::submit(0); + bgfx::submit(0, program); } } |