blob: a637a55f12efe7befc83ae1a99fa9a5150a523ea [file] [log] [blame]
Geoff Lang49be2ad2014-02-28 13:05:51 -05001//
2// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
Jamie Madill1cfaaf82014-08-21 10:04:04 -04007#include "OSWindow.h"
Geoff Lang49be2ad2014-02-28 13:05:51 -05008
Jamie Madill1cfaaf82014-08-21 10:04:04 -04009OSWindow::OSWindow()
Geoff Lang49be2ad2014-02-28 13:05:51 -050010 : mWidth(0),
11 mHeight(0)
12{
13}
14
Jamie Madill44771092014-08-28 09:21:35 -040015OSWindow::~OSWindow()
16{}
17
Jamie Madill1cfaaf82014-08-21 10:04:04 -040018int OSWindow::getWidth() const
Geoff Lang49be2ad2014-02-28 13:05:51 -050019{
20 return mWidth;
21}
22
Jamie Madill1cfaaf82014-08-21 10:04:04 -040023int OSWindow::getHeight() const
Geoff Lang49be2ad2014-02-28 13:05:51 -050024{
25 return mHeight;
26}
27
Jamie Madill1cfaaf82014-08-21 10:04:04 -040028bool OSWindow::popEvent(Event *event)
Geoff Lang49be2ad2014-02-28 13:05:51 -050029{
30 if (mEvents.size() > 0 && event)
31 {
32 *event = mEvents.front();
33 mEvents.pop_front();
34 return true;
35 }
36 else
37 {
38 return false;
39 }
40}
41
Jamie Madill1cfaaf82014-08-21 10:04:04 -040042void OSWindow::pushEvent(Event event)
Geoff Lang49be2ad2014-02-28 13:05:51 -050043{
44 switch (event.Type)
45 {
46 case Event::EVENT_RESIZED:
47 mWidth = event.Size.Width;
48 mHeight = event.Size.Height;
49 break;
50 }
51
52 mEvents.push_back(event);
53}