blob: 2a23176f6386fb7b9896386892e4eac217e68de3 [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
7#include "Window.h"
8
9Window::Window()
10 : mWidth(0),
11 mHeight(0)
12{
13}
14
15int Window::getWidth() const
16{
17 return mWidth;
18}
19
20int Window::getHeight() const
21{
22 return mHeight;
23}
24
25bool Window::popEvent(Event *event)
26{
27 if (mEvents.size() > 0 && event)
28 {
29 *event = mEvents.front();
30 mEvents.pop_front();
31 return true;
32 }
33 else
34 {
35 return false;
36 }
37}
38
39void Window::pushEvent(Event event)
40{
41 switch (event.Type)
42 {
43 case Event::EVENT_RESIZED:
44 mWidth = event.Size.Width;
45 mHeight = event.Size.Height;
46 break;
47 }
48
49 mEvents.push_back(event);
50}