bgfx/examples
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
..
00-helloworld Removed _BIT suffix from BGFX_CLEAR_* flags. 2015-01-10 21:39:45 -08:00
01-cubes VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
02-metaballs VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
03-raymarch Refactored uniform types. 2015-05-28 15:27:00 -07:00
04-mesh VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
05-instancing VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
06-bump VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
07-callback Fixed build. 2015-03-26 15:04:09 -07:00
08-update Refactored uniform types. 2015-05-28 15:27:00 -07:00
09-hdr Refactored uniform types. 2015-05-28 15:27:00 -07:00
10-font VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
11-fontsdf VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
12-lod VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
13-stencil Refactored uniform types. 2015-05-28 15:27:00 -07:00
14-shadowvolumes VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
15-shadowmaps-simple Refactored uniform types. 2015-05-28 15:27:00 -07:00
16-shadowmaps Refactored uniform types. 2015-05-28 15:27:00 -07:00
17-drawstress Refactored uniform types. 2015-05-28 15:27:00 -07:00
18-ibl Refactored uniform types. 2015-05-28 15:27:00 -07:00
19-oit Refactored uniform types. 2015-05-28 15:27:00 -07:00
20-nanovg Fixed issue #353. 2015-04-19 18:12:09 -07:00
21-deferred Refactored uniform types. 2015-05-28 15:27:00 -07:00
22-windows Removed _BIT suffix from BGFX_CLEAR_* flags. 2015-01-10 21:39:45 -08:00
23-vectordisplay Refactored uniform types. 2015-05-28 15:27:00 -07:00
24-nbody VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
25-c99 Updated C99 API. 2015-03-27 22:09:10 -07:00
assets/meshes Updated copyright year. 2015-01-02 14:43:11 -08:00
common VR: Add device resolution to HMD. Init at startup. 2015-06-03 15:39:09 -07:00
runtime Refactored uniform types. 2015-05-28 15:27:00 -07:00
makefile Updated copyright year. 2015-01-02 14:43:11 -08:00