OpenEnroth 73e68f7
|
#include <PlatformApplication.h>
Public Member Functions | |
PlatformApplication (Platform *platform) | |
~PlatformApplication () | |
void | initializeOpenGLContext (const PlatformOpenGLOptions &options) |
void | initializeOpenGLContext (std::unique_ptr< PlatformOpenGLContext > context) |
Platform * | platform () |
PlatformEventLoop * | eventLoop () |
PlatformWindow * | window () |
PlatformOpenGLContext * | openGLContext () |
PlatformEventHandler * | eventHandler () |
template<class T > | |
T * | installComponent (std::unique_ptr< T > component) |
template<class T > | |
std::unique_ptr< T > | removeComponent () |
const PlatformComponentStorage * | components () const |
template<class T > | |
T * | component () const |
void | processMessages (int count=-1) |
void | waitForMessages () |
Private Member Functions | |
void | installComponentInternal (ProxyPlatform *platform) |
void | removeComponentInternal (ProxyPlatform *platform) |
void | installComponentInternal (ProxyEventLoop *eventLoop) |
void | removeComponentInternal (ProxyEventLoop *eventLoop) |
void | installComponentInternal (ProxyWindow *window) |
void | removeComponentInternal (ProxyWindow *window) |
void | installComponentInternal (ProxyOpenGLContext *openGLContext) |
void | removeComponentInternal (ProxyOpenGLContext *openGLContext) |
void | installComponentInternal (PlatformEventFilter *eventFilter) |
void | removeComponentInternal (PlatformEventFilter *eventFilter) |
void | installComponentInternal (PlatformApplicationAware *aware) |
void | removeComponentInternal (PlatformApplicationAware *aware) |
Private Attributes | |
Platform * | _platform |
std::unique_ptr< PlatformEventLoop > | _eventLoop |
std::unique_ptr< PlatformWindow > | _window |
std::unique_ptr< PlatformOpenGLContext > | _openGLContext |
std::unique_ptr< FilteringEventHandler > | _eventHandler |
std::unique_ptr< ApplicationProxy > | _rootProxy |
PlatformComponentStorage | _components |
Friends | |
class | PlatformApplicationAware |
This class ties together everything in platform for a particular use case of an application with a single window.
The proper way to use it is by creating components that implement the pieces of functionality that you need, and then installing them into the PlatformApplication
.
Supported base classes for components are:
PlatformEventFilter
;PlatformApplicationAware
.Components can have multiple bases, this is handled automatically. If you want to use private bases, befriend PlatformIntrospection
.
The components you install are inserted into the proxy and event filter chains exactly in the order of installation. The ordering is usually important, so it makes sense to install everything in a single place. If this model doesn't work for you (e.g. you have two components that implement several proxies that need to be ordered differently w.r.t. each other), then you'll have to split your component into several parts.
|
explicit |
PlatformApplication::~PlatformApplication | ( | ) |
|
inline |
|
inline |
PlatformEventHandler * PlatformApplication::eventHandler | ( | ) |
PlatformEventLoop * PlatformApplication::eventLoop | ( | ) |
void PlatformApplication::initializeOpenGLContext | ( | const PlatformOpenGLOptions & | options | ) |
void PlatformApplication::initializeOpenGLContext | ( | std::unique_ptr< PlatformOpenGLContext > | context | ) |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
PlatformOpenGLContext * PlatformApplication::openGLContext | ( | ) |
Platform * PlatformApplication::platform | ( | ) |
void PlatformApplication::processMessages | ( | int | count = -1 | ) |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void PlatformApplication::waitForMessages | ( | ) |
PlatformWindow * PlatformApplication::window | ( | ) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |