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: // SwapChain9.h: Defines a back-end specific class for the D3D9 swap chain. michael@0: michael@0: #ifndef LIBGLESV2_RENDERER_SWAPCHAIN9_H_ michael@0: #define LIBGLESV2_RENDERER_SWAPCHAIN9_H_ michael@0: michael@0: #include "common/angleutils.h" michael@0: #include "libGLESv2/renderer/SwapChain.h" michael@0: michael@0: namespace rx michael@0: { michael@0: class Renderer9; michael@0: michael@0: class SwapChain9 : public SwapChain michael@0: { michael@0: public: michael@0: SwapChain9(Renderer9 *renderer, HWND window, HANDLE shareHandle, michael@0: GLenum backBufferFormat, GLenum depthBufferFormat); michael@0: virtual ~SwapChain9(); michael@0: michael@0: EGLint resize(EGLint backbufferWidth, EGLint backbufferHeight); michael@0: virtual EGLint reset(EGLint backbufferWidth, EGLint backbufferHeight, EGLint swapInterval); michael@0: virtual EGLint swapRect(EGLint x, EGLint y, EGLint width, EGLint height); michael@0: virtual void recreate(); michael@0: michael@0: virtual IDirect3DSurface9 *getRenderTarget(); michael@0: virtual IDirect3DSurface9 *getDepthStencil(); michael@0: virtual IDirect3DTexture9 *getOffscreenTexture(); michael@0: michael@0: static SwapChain9 *makeSwapChain9(SwapChain *swapChain); michael@0: michael@0: private: michael@0: DISALLOW_COPY_AND_ASSIGN(SwapChain9); michael@0: michael@0: void release(); michael@0: michael@0: Renderer9 *mRenderer; michael@0: EGLint mHeight; michael@0: EGLint mWidth; michael@0: EGLint mSwapInterval; michael@0: michael@0: IDirect3DSwapChain9 *mSwapChain; michael@0: IDirect3DSurface9 *mBackBuffer; michael@0: IDirect3DSurface9 *mRenderTarget; michael@0: IDirect3DSurface9 *mDepthStencil; michael@0: IDirect3DTexture9* mOffscreenTexture; michael@0: }; michael@0: michael@0: } michael@0: #endif // LIBGLESV2_RENDERER_SWAPCHAIN9_H_