- testing for current threading structures
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <fennec/platform/interface/platform.h>
|
||||
#include <fennec/platform/interface/display_server.h>
|
||||
#include <fennec/platform/interface/window.h>
|
||||
#include <fennec/threading/lock_guard.h>
|
||||
|
||||
namespace fennec {
|
||||
|
||||
@@ -85,7 +86,29 @@ void window_manager::shutdown() {
|
||||
void window_manager::dispatch() {
|
||||
assertf(_thread == thread::current(), "Attempted to dispatch Window Manager on a different thread!");
|
||||
|
||||
lock_guard guard(_lock);
|
||||
_display->dispatch();
|
||||
}
|
||||
|
||||
window_manager::window_id window_manager::create_window(const window::config& config, window_id parent) {
|
||||
assertf(_thread == thread::current(), "Attempted to create a window on a different thread!");
|
||||
|
||||
lock_guard guard(_lock);
|
||||
window* p = parent == nullid ? nullptr : _windows[parent].get();
|
||||
return _windows.emplace(_display->create_window(config, p));
|
||||
}
|
||||
|
||||
void window_manager::begin(window_id window) {
|
||||
assertf(_thread == thread::current(), "Attempted to set window context on a different thread!");
|
||||
|
||||
lock_guard guard(_lock);
|
||||
_windows[window]->begin_frame();
|
||||
}
|
||||
|
||||
void window_manager::end(window_id window) {
|
||||
assertf(_thread == thread::current(), "Attempted to set window context on a different thread!");
|
||||
|
||||
lock_guard guard(_lock);
|
||||
_windows[window]->end_frame();
|
||||
}
|
||||
} // fennec
|
||||
Reference in New Issue
Block a user