Big f***ing cleanup part 1
This commit is contained in:
@@ -10,9 +10,7 @@
|
||||
#define NAZARA_WINDOW_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Core/ConditionVariable.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Core/Mutex.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
#include <Nazara/Platform/Config.hpp>
|
||||
@@ -23,6 +21,8 @@
|
||||
#include <Nazara/Platform/Icon.hpp>
|
||||
#include <Nazara/Platform/VideoMode.hpp>
|
||||
#include <Nazara/Platform/WindowHandle.hpp>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
|
||||
namespace Nz
|
||||
@@ -126,13 +126,13 @@ namespace Nz
|
||||
|
||||
std::queue<WindowEvent> m_events;
|
||||
std::vector<WindowEvent> m_pendingEvents;
|
||||
ConditionVariable m_eventCondition;
|
||||
std::condition_variable m_eventCondition;
|
||||
CursorController m_cursorController;
|
||||
CursorRef m_cursor;
|
||||
EventHandler m_eventHandler;
|
||||
IconRef m_icon;
|
||||
Mutex m_eventMutex;
|
||||
Mutex m_eventConditionMutex;
|
||||
std::mutex m_eventMutex;
|
||||
std::mutex m_eventConditionMutex;
|
||||
bool m_asyncWindow;
|
||||
bool m_closed;
|
||||
bool m_closeOnQuit;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <Nazara/Platform/Window.hpp>
|
||||
#include <Nazara/Core/ErrorFlags.hpp>
|
||||
#include <Nazara/Core/LockGuard.hpp>
|
||||
#include <Nazara/Platform/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
@@ -98,16 +97,15 @@ namespace Nz
|
||||
else
|
||||
{
|
||||
{
|
||||
LockGuard eventLock(m_eventMutex);
|
||||
std::lock_guard<std::mutex> eventLock(m_eventMutex);
|
||||
|
||||
m_pendingEvents.push_back(event);
|
||||
}
|
||||
|
||||
if (m_waitForEvent)
|
||||
{
|
||||
m_eventConditionMutex.Lock();
|
||||
m_eventCondition.Signal();
|
||||
m_eventConditionMutex.Unlock();
|
||||
std::lock_guard<std::mutex> lock(m_eventConditionMutex);
|
||||
m_eventCondition.notify_all();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user