diff options
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); } } |