michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // SwapChain.h: Defines a back-end specific class that hides the details of the michael@0: // implementation-specific swapchain. michael@0: michael@0: #ifndef LIBGLESV2_RENDERER_SWAPCHAIN_H_ michael@0: #define LIBGLESV2_RENDERER_SWAPCHAIN_H_ michael@0: michael@0: #include "common/angleutils.h" michael@0: michael@0: namespace rx michael@0: { michael@0: michael@0: class SwapChain michael@0: { michael@0: public: michael@0: SwapChain(HWND window, HANDLE shareHandle, GLenum backBufferFormat, GLenum depthBufferFormat) michael@0: : mWindow(window), mShareHandle(shareHandle), mBackBufferFormat(backBufferFormat), mDepthBufferFormat(depthBufferFormat) michael@0: { michael@0: } michael@0: michael@0: virtual ~SwapChain() {}; michael@0: michael@0: virtual EGLint resize(EGLint backbufferWidth, EGLint backbufferSize) = 0; michael@0: virtual EGLint reset(EGLint backbufferWidth, EGLint backbufferHeight, EGLint swapInterval) = 0; michael@0: virtual EGLint swapRect(EGLint x, EGLint y, EGLint width, EGLint height) = 0; michael@0: virtual void recreate() = 0; michael@0: michael@0: virtual HANDLE getShareHandle() {return mShareHandle;}; michael@0: michael@0: protected: michael@0: const HWND mWindow; // Window that the surface is created for. michael@0: const GLenum mBackBufferFormat; michael@0: const GLenum mDepthBufferFormat; michael@0: michael@0: HANDLE mShareHandle; michael@0: }; michael@0: michael@0: } michael@0: #endif // LIBGLESV2_RENDERER_SWAPCHAIN_H_