Hash :
1cfaaf8a
Author :
Date :
2014-08-21T10:04:04
Add a util project to share between samples and tests. This code shares the Window and EGL logic between the two projects. BUG=angle:730 Change-Id: I8940371226a8f7b02579c332f51679c4a5d0e2a5 Reviewed-on: https://chromium-review.googlesource.com/212799 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
//
// 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)
{
}
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);
}