Edit

kc3-lang/angle/util/OSWindow.cpp

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2014-10-01 10:41:40
    Hash : 4119ed3d
    Message : Make OSWindow a non-static member of ANGLETest. BUG=angle:611 Change-Id: I455e1dd0ad5582191621e316c4808a2d753e9aaa Reviewed-on: https://chromium-review.googlesource.com/219867 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>

  • util/OSWindow.cpp
  • //
    // 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);
    }