Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / samples / angle / sample_util / Window.h
1 //
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 #ifndef SAMPLE_UTIL_WINDOW_H
8 #define SAMPLE_UTIL_WINDOW_H
9
10 #include "Event.h"
11
12 #include <EGL/egl.h>
13 #include <EGL/eglext.h>
14 #include <list>
15
16 class Window
17 {
18   public:
19     Window();
20
21     virtual bool initialize(const std::string &name, size_t width, size_t height) = 0;
22     virtual void destroy() = 0;
23
24     int getWidth() const;
25     int getHeight() const;
26     virtual void setMousePosition(int x, int y) = 0;
27
28     virtual EGLNativeWindowType getNativeWindow() const = 0;
29     virtual EGLNativeDisplayType getNativeDisplay() const = 0;
30
31     virtual void messageLoop() = 0;
32
33     bool popEvent(Event *event);
34     void pushEvent(Event event);
35
36   private:
37     int mWidth;
38     int mHeight;
39
40     std::list<Event> mEvents;
41 };
42
43 #endif // SAMPLE_UTIL_WINDOW_H