Massive refactoring of xenia::ui and GL swap behavior.

This seems to dramatically improve most games (especially with
--vsync=false), though it may cause swap issues with others.
New code should be easier to port, and enables elemental-forms to be
drawn for any emulator UI.
This commit is contained in:
Ben Vanik
2015-07-12 22:03:47 -07:00
parent e69c7b00a8
commit 15c17459be
61 changed files with 1994 additions and 2623 deletions

View File

@@ -11,20 +11,34 @@
#define XENIA_UI_LOOP_H_
#include <functional>
#include <memory>
#include "xenia/base/delegate.h"
#include "xenia/ui/ui_event.h"
namespace xe {
namespace ui {
class Loop {
public:
Loop() = default;
virtual ~Loop() = default;
static std::unique_ptr<Loop> Create();
static Loop* elemental_loop();
// Sets the loop designated as being the main loop elemental-forms will use
// for all activity.
static void set_elemental_loop(Loop* loop);
Loop();
virtual ~Loop();
virtual void Post(std::function<void()> fn) = 0;
virtual void PostDelayed(std::function<void()> fn, uint64_t delay_millis) = 0;
void PostSynchronous(std::function<void()> fn);
virtual void Quit() = 0;
virtual void AwaitQuit() = 0;
Delegate<UIEvent> on_quit;
};
} // namespace ui