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 enum RendererType 17 { 18 RENDERER_D3D9, 19 RENDERER_D3D11 20 }; 21 22 class Window 23 { 24 public: 25 Window(); 26 27 virtual bool initialize(const std::string &name, size_t width, size_t height, RendererType requestedRenderer) = 0; 28 virtual void destroy() = 0; 29 30 int getWidth() const; 31 int getHeight() const; 32 virtual void setMousePosition(int x, int y) = 0; 33 34 virtual EGLDisplay getDisplay() const = 0; 35 virtual EGLNativeWindowType getNativeWindow() const = 0; 36 virtual EGLNativeDisplayType getNativeDisplay() const = 0; 37 38 virtual void messageLoop() = 0; 39 40 bool popEvent(Event *event); 41 void pushEvent(Event event); 42 43 private: 44 int mWidth; 45 int mHeight; 46 47 std::list<Event> mEvents; 48 }; 49 50 #endif // SAMPLE_UTIL_WINDOW_H 51