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 // RenderTarget.h: Defines an abstract wrapper class to manage IDirect3DSurface9 8 // and ID3D11View objects belonging to renderbuffers. 9 10 #ifndef LIBGLESV2_RENDERER_RENDERTARGET_H_ 11 #define LIBGLESV2_RENDERER_RENDERTARGET_H_ 12 13 #include "common/angleutils.h" 14 #include "libGLESv2/angletypes.h" 15 16 namespace rx 17 { 18 class RenderTarget 19 { 20 public: 21 RenderTarget() 22 { 23 mWidth = 0; 24 mHeight = 0; 25 mDepth = 0; 26 mInternalFormat = GL_NONE; 27 mActualFormat = GL_NONE; 28 mSamples = 0; 29 } 30 31 virtual ~RenderTarget() {}; 32 33 GLsizei getWidth() const { return mWidth; } 34 GLsizei getHeight() const { return mHeight; } 35 GLsizei getDepth() const { return mDepth; } 36 GLenum getInternalFormat() const { return mInternalFormat; } 37 GLenum getActualFormat() const { return mActualFormat; } 38 GLsizei getSamples() const { return mSamples; } 39 gl::Extents getExtents() const { return gl::Extents(mWidth, mHeight, mDepth); } 40 41 virtual void invalidate(GLint x, GLint y, GLsizei width, GLsizei height) = 0; 42 43 struct Desc { 44 GLsizei width; 45 GLsizei height; 46 GLsizei depth; 47 GLenum format; 48 }; 49 50 protected: 51 GLsizei mWidth; 52 GLsizei mHeight; 53 GLsizei mDepth; 54 GLenum mInternalFormat; 55 GLenum mActualFormat; 56 GLsizei mSamples; 57 58 private: 59 DISALLOW_COPY_AND_ASSIGN(RenderTarget); 60 }; 61 62 } 63 64 #endif // LIBGLESV2_RENDERTARGET_H_ 65