daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2012 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 | // SwapChain.h: Defines a back-end specific class that hides the details of the |
| 8 | // implementation-specific swapchain. |
| 9 | |
| 10 | #ifndef LIBGLESV2_RENDERER_SWAPCHAIN_H_ |
| 11 | #define LIBGLESV2_RENDERER_SWAPCHAIN_H_ |
| 12 | |
daniel@transgaming.com | 76d3e6e | 2012-10-31 19:55:33 +0000 | [diff] [blame] | 13 | #include "common/angleutils.h" |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 14 | |
Geoff Lang | 1727a0a | 2013-10-15 16:07:38 -0400 | [diff] [blame] | 15 | #if !defined(ANGLE_FORCE_VSYNC_OFF) |
| 16 | #define ANGLE_FORCE_VSYNC_OFF 0 |
| 17 | #endif |
| 18 | |
daniel@transgaming.com | 76d3e6e | 2012-10-31 19:55:33 +0000 | [diff] [blame] | 19 | namespace rx |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 20 | { |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 21 | |
| 22 | class SwapChain |
| 23 | { |
| 24 | public: |
daniel@transgaming.com | a27e05b | 2012-11-28 19:39:42 +0000 | [diff] [blame] | 25 | SwapChain(HWND window, HANDLE shareHandle, GLenum backBufferFormat, GLenum depthBufferFormat) |
| 26 | : mWindow(window), mShareHandle(shareHandle), mBackBufferFormat(backBufferFormat), mDepthBufferFormat(depthBufferFormat) |
| 27 | { |
| 28 | } |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 29 | |
daniel@transgaming.com | a27e05b | 2012-11-28 19:39:42 +0000 | [diff] [blame] | 30 | virtual ~SwapChain() {}; |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 31 | |
shannon.woods@transgaming.com | c71ca75 | 2013-02-28 23:06:50 +0000 | [diff] [blame] | 32 | virtual EGLint resize(EGLint backbufferWidth, EGLint backbufferSize) = 0; |
daniel@transgaming.com | a27e05b | 2012-11-28 19:39:42 +0000 | [diff] [blame] | 33 | virtual EGLint reset(EGLint backbufferWidth, EGLint backbufferHeight, EGLint swapInterval) = 0; |
| 34 | virtual EGLint swapRect(EGLint x, EGLint y, EGLint width, EGLint height) = 0; |
shannon.woods%transgaming.com@gtempaccount.com | 88079a0 | 2013-03-23 18:43:24 +0000 | [diff] [blame] | 35 | virtual void recreate() = 0; |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 36 | |
daniel@transgaming.com | a27e05b | 2012-11-28 19:39:42 +0000 | [diff] [blame] | 37 | virtual HANDLE getShareHandle() {return mShareHandle;}; |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 38 | |
daniel@transgaming.com | a27e05b | 2012-11-28 19:39:42 +0000 | [diff] [blame] | 39 | protected: |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 40 | const HWND mWindow; // Window that the surface is created for. |
| 41 | const GLenum mBackBufferFormat; |
| 42 | const GLenum mDepthBufferFormat; |
daniel@transgaming.com | 3c72078 | 2012-10-31 18:42:34 +0000 | [diff] [blame] | 43 | |
| 44 | HANDLE mShareHandle; |
| 45 | }; |
| 46 | |
| 47 | } |
| 48 | #endif // LIBGLESV2_RENDERER_SWAPCHAIN_H_ |