summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/26-occlusion/occlusion.cpp')
-rw-r--r--3rdparty/bgfx/examples/26-occlusion/occlusion.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
index 8ae2b3e0890..634aaa6cc9a 100644
--- a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
+++ b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
@@ -190,20 +190,20 @@ class ExampleOcclusion : public entry::AppI
else
{
float proj[16];
- bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f);
+ bx::mtxProj(proj, 90.0f, float(width)/float(height), 0.1f, 10000.0f, bgfx::getCaps()->homogeneousDepth);
bgfx::setViewTransform(0, view, proj);
- bgfx::setViewRect(0, 0, 0, width, height);
+ bgfx::setViewRect(0, 0, 0, uint16_t(width), uint16_t(height) );
bgfx::setViewTransform(1, view, proj);
- bgfx::setViewRect(1, 0, 0, width, height);
+ bgfx::setViewRect(1, 0, 0, uint16_t(width), uint16_t(height) );
float at[3] = { 0.0f, 0.0f, 0.0f };
float eye[3] = { 17.5f, 10.0f, -17.5f };
bx::mtxLookAt(view, eye, at);
bgfx::setViewTransform(2, view, proj);
- bgfx::setViewRect(2, 10, height - height/4 - 10, width/4, height/4);
+ bgfx::setViewRect(2, 10, uint16_t(height - height/4 - 10), uint16_t(width/4), uint16_t(height/4) );
}
bgfx::touch(0);
@@ -251,11 +251,15 @@ class ExampleOcclusion : public entry::AppI
}
}
- for (uint32_t xx = 0; xx < CUBES_DIM; ++xx)
+ for (uint16_t xx = 0; xx < CUBES_DIM; ++xx)
{
bgfx::dbgTextImage(5 + xx*2, 5, 1, CUBES_DIM, img + xx*2, CUBES_DIM*2);
}
+ int32_t numPixels = 0;
+ bgfx::getResult(m_occlusionQueries[0], &numPixels);
+ bgfx::dbgTextPrintf(5, 5 + CUBES_DIM + 1, 0xf, "%d", numPixels);
+
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();