mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
BUG=angle:734 Change-Id: I6deb639abc26a314dd890189613e0a3a2e1be1d2 Reviewed-on: https://chromium-review.googlesource.com/214714 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
54 lines
850 B
C++
54 lines
850 B
C++
//
|
|
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
//
|
|
|
|
#include "OSWindow.h"
|
|
|
|
OSWindow::OSWindow()
|
|
: mWidth(0),
|
|
mHeight(0)
|
|
{
|
|
}
|
|
|
|
OSWindow::~OSWindow()
|
|
{}
|
|
|
|
int OSWindow::getWidth() const
|
|
{
|
|
return mWidth;
|
|
}
|
|
|
|
int OSWindow::getHeight() const
|
|
{
|
|
return mHeight;
|
|
}
|
|
|
|
bool OSWindow::popEvent(Event *event)
|
|
{
|
|
if (mEvents.size() > 0 && event)
|
|
{
|
|
*event = mEvents.front();
|
|
mEvents.pop_front();
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
void OSWindow::pushEvent(Event event)
|
|
{
|
|
switch (event.Type)
|
|
{
|
|
case Event::EVENT_RESIZED:
|
|
mWidth = event.Size.Width;
|
|
mHeight = event.Size.Height;
|
|
break;
|
|
}
|
|
|
|
mEvents.push_back(event);
|
|
}
|