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 OSWindow 17 { 18 public: 19 OSWindow(); 20 virtual ~OSWindow(); 21 22 virtual bool initialize(const std::string &name, size_t width, size_t height) = 0; 23 virtual void destroy() = 0; 24 25 int getWidth() const; 26 int getHeight() const; 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 virtual void pushEvent(Event event); 35 36 virtual void setMousePosition(int x, int y) = 0; 37 virtual bool resize(int width, int height) = 0; 38 virtual bool setVisible(bool isVisible) = 0; 39 40 protected: 41 int mWidth; 42 int mHeight; 43 44 std::list<Event> mEvents; 45 }; 46 47 OSWindow *CreateOSWindow(); 48 49 #endif // SAMPLE_UTIL_WINDOW_H 50