mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
WIP support for key/mouse events in examples.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user