Skip to content

Instantly share code, notes, and snippets.

@hugoam
Last active April 15, 2018 20:46
Show Gist options
  • Save hugoam/5009198c58150dea7547ec5552cc7b3d to your computer and use it in GitHub Desktop.
Save hugoam/5009198c58150dea7547ec5552cc7b3d to your computer and use it in GitHub Desktop.
Minimal bgfx
void main()
{
// window context creation code goes here
bgfx::PlatformData pd = {};
pd.nwh = // windows native handle goes here
bgfx::setPlatformData(pd);
bgfx::init();
uint32_t width = // context width goes here
uint32_t height = // context height goes here
bgfx::reset(width, height, BGFX_RESET_NONE);
bgfx::setViewRect(0, 0, 0, uint16_t(width), uint16_t(height));
bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0);
while(true)
{
bgfx::touch(0);
bgfx::frame();
}
bgfx::shutdown();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment