bgfx/examples/common
Matthew Endsley 1e604e8f38 VR: Add device resolution to HMD. Init at startup.
BREAKING: bgfx::getHMD() now returns a valid pointer
if the VR runtime was initialized. This is different
from existing behavior where getHMD returned NULL until
a bgfx::reset(... BGFX_RESET_HMD) was issued. Applications
must now check HMD::flags for the current state of the VR
runtime. The following code has the code change required:

`const bgfx::HMD* hmd = bgfx::getHMD()
if (NULL != hmd)`
becomes:
`const bgfx::HMD* hmd = bgfx::getHMD()
if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDRERING))
{
	// rendering logic
}`

See the updated examples for details.

This allows applications to create the appropriately
sized back buffer for the HMD device by using the new device
resolution fields HMD::deviceHeight and HMD::deviceWidth.
These values report the pixel resolution of the attached
HMD hardware.

This also allows applications to query the reported HMD
resolution immediately after bgfx::init. This prevents
the device from being cycled which generates rendring
artifacts on startup - namely flashing back to a black
screen and reseting the Health+Warning disaply.

This involves initialization the ovrHmd device on
initialization, but deferring rendering until
postReset has been called. This adds an addiional
memory overhead of 32k to builds defining BGFX_CONFIG_USE_OVR.
The overhead for current builds is ~1.9MB for calls to
ovr_Initialize, so the additional overhead is pretty
trivial (+1.8%)
2015-06-03 15:39:09 -07:00
..
entry Added ocornut-imgui key mapping. 2015-06-02 14:28:22 -07:00
font Refactored uniform types. 2015-05-28 15:27:00 -07:00
imgui VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
nanovg Refactored uniform types. 2015-05-28 15:27:00 -07:00
aviwriter.h Updated copyright year. 2015-01-01 15:04:46 -08:00
bgfx_utils.cpp Cleanup. 2015-06-01 17:45:40 -07:00
bgfx_utils.h Cleanup. 2015-06-01 17:45:40 -07:00
bounds.cpp Fixed VS2015 warnings. 2015-03-29 11:47:32 -07:00
bounds.h Updated copyright year. 2015-01-01 15:04:46 -08:00
camera.cpp Cleanup. 2014-12-15 20:59:22 -08:00
camera.h Cleanup. 2014-12-15 20:59:22 -08:00
common.h Moving TinyStlCustomAllocator inside entry. 2015-02-08 12:34:06 +01:00
common.sh Updated copyright year. 2015-01-02 14:43:11 -08:00
cube_atlas.cpp Cleanup. 2015-02-16 21:58:13 -08:00
cube_atlas.h Fixed C4244 warnings. 2014-01-20 22:07:08 -08:00
packrect.h Updated copyright year. 2015-01-01 15:04:46 -08:00
shaderlib.sh Added toLinear/GammaAccurate shader functions. 2015-02-17 16:26:10 -08:00