When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine. So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
26 lines
No EOL
372 B
C++
26 lines
No EOL
372 B
C++
|
|
#include <Spectre/System/MessageQueue.h>
|
|
|
|
namespace sp {
|
|
|
|
void MessageQueue::postEvent(SysEvent& event)
|
|
{
|
|
m_queue.push_back(event);
|
|
}
|
|
|
|
bool MessageQueue::pollEvent(SysEvent& event)
|
|
{
|
|
if (!isEmpty()) {
|
|
event = m_queue.front();
|
|
m_queue.pop_front();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool MessageQueue::isEmpty() const
|
|
{
|
|
return m_queue.empty();
|
|
}
|
|
|
|
} // namespace sp
|