WIP support for key/mouse events in examples.

This commit is contained in:
bkaradzic
2013-01-16 22:44:51 -08:00
parent ea24244317
commit c3667bad05
19 changed files with 642 additions and 338 deletions

View File

@@ -7,17 +7,19 @@
#include <bx/bx.h>
#include "../common/entry.h"
#include "../common/dbg.h"
#include "../common/processevents.h"
int _main_(int _argc, char** _argv)
{
bgfx::init();
bgfx::reset(1280, 720);
// Enable debug text.
bgfx::setDebug(BGFX_DEBUG_TEXT);
// Set view 0 default viewport.
bgfx::setViewRect(0, 0, 0, 1280, 720);
uint32_t width = 1280;
uint32_t height = 720;
uint32_t debug = BGFX_DEBUG_TEXT;
bgfx::init();
bgfx::reset(width, height);
// Enable debug text.
bgfx::setDebug(debug);
// Set view 0 clear state.
bgfx::setViewClear(0
@@ -27,8 +29,11 @@ int _main_(int _argc, char** _argv)
, 0
);
while (entry::Event::Exit != entry::poll() )
{
while (!processEvents(width, height, debug) )
{
// Set view 0 default viewport.
bgfx::setViewRect(0, 0, 0, width, height);
// 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);