- More Documentation
- Vulkan Configuration Implementations - Fixed build errors on GCC and Clang
This commit is contained in:
@@ -45,13 +45,13 @@ void window_manager::initialize() {
|
||||
|
||||
// Find first valid server
|
||||
while (not display_servers.is_empty()) {
|
||||
display_server::entry it = display_servers.front();
|
||||
const display_server::entry it = display_servers.front();
|
||||
display_servers.pop();
|
||||
|
||||
unique_ptr<display_server> server = unique_ptr(it.ctor(_platform));
|
||||
server->connect();
|
||||
if (server->connected()) {
|
||||
logger::log(format("Selected {} for the display server.", server->get_type().name()));
|
||||
logger::log(logger::info, format("Selected {} for the display server.", server->get_type().name()));
|
||||
_display = move(server);
|
||||
break;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ void window_manager::initialize() {
|
||||
|
||||
_thread = thread::current();
|
||||
|
||||
logger::log(format("Initializing Window Manager on thread: {:#016x}.", _thread));
|
||||
logger::log(logger::info, format("Initializing Window Manager on thread: {:#016x}.", _thread));
|
||||
}
|
||||
|
||||
void window_manager::shutdown() {
|
||||
@@ -92,6 +92,11 @@ void window_manager::dispatch() {
|
||||
assertf(_thread == thread::current(), "Attempted to dispatch Window Manager on a different thread!");
|
||||
lock_guard guard(_lock);
|
||||
|
||||
size_t n = _commands.size();
|
||||
while (n--) {
|
||||
_commands.pop();
|
||||
}
|
||||
|
||||
_display->dispatch();
|
||||
}
|
||||
|
||||
@@ -104,7 +109,7 @@ window_id window_manager::create_window(const window::config& config, window_id
|
||||
lock_guard guard(_lock);
|
||||
|
||||
window* p = parent == nullid ? nullptr : _windows[parent].get();
|
||||
window_id id = _windows.emplace(_display->create_window(config, p));
|
||||
const window_id id = _windows.emplace(_display->create_window(config, p));
|
||||
_windows[id]->initialize();
|
||||
return id;
|
||||
}
|
||||
@@ -144,11 +149,25 @@ void window_manager::close(window_id window) {
|
||||
_windows.erase(window);
|
||||
}
|
||||
|
||||
window_id window_manager::_parent(window_id) const {
|
||||
window_id window_manager::_parent(window_id id) const {
|
||||
window_id it = 0;
|
||||
for (const auto& window : _windows) {
|
||||
if (window.get() == _windows[id]->parent) {
|
||||
return it;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return nullid;
|
||||
}
|
||||
|
||||
window_id window_manager::_root(window_id) const {
|
||||
window_id window_manager::_root(window_id id) const {
|
||||
window_id it = 0;
|
||||
for (const auto& window : _windows) {
|
||||
if (window.get() == _windows[id]->root) {
|
||||
return it;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return nullid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user