1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_OffScreenBuffer.h 4 5 Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Revision: 23585 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NW_GFX_OFFSCREENBUFFER_H_ 17 #define NW_GFX_OFFSCREENBUFFER_H_ 18 19 #include <nw/gfx/gfx_IRenderTarget.h> 20 #include <nw/ut/ut_Preprocessor.h> 21 #include <nw/gfx/res/gfx_ResTexture.h> 22 #include <nw/gfx/gfx_FrameBuffer.h> 23 24 namespace nw 25 { 26 namespace os 27 { 28 class IAllocator; 29 } // namespace os 30 31 namespace gfx 32 { 33 34 //--------------------------------------------------------------------------- 35 //! @brief 画面に表示しない描画対象を表すクラスです。 36 //--------------------------------------------------------------------------- 37 class OffScreenBuffer : public IRenderTarget 38 { 39 private: 40 NW_DISALLOW_COPY_AND_ASSIGN(OffScreenBuffer); 41 42 public: 43 NW_UT_RUNTIME_TYPEINFO; 44 45 //! 設定内容を取得します。 GetDescription()46 virtual const Description& GetDescription() const { return m_Description; } 47 48 //--------------------------------------------------------------------------- 49 //! @brief バッファオブジェクトを取得します。 50 //! 51 //! @return バッファオブジェクトを返します。 52 //--------------------------------------------------------------------------- GetBufferObject()53 virtual const FrameBufferObject& GetBufferObject() const { return m_BackBufferObject; } 54 55 private: 56 //--------------------------------------------------------------------------- 57 //! @brief コンストラクタです。 58 //--------------------------------------------------------------------------- 59 OffScreenBuffer(os::IAllocator* pAllocator, const Description& description, ResPixelBasedTexture resTexture); 60 61 //--------------------------------------------------------------------------- 62 //! @brief デストラクタです。 63 //--------------------------------------------------------------------------- 64 virtual ~OffScreenBuffer(); 65 66 // GLuint m_BackBufferObject; 67 FrameBufferObject m_BackBufferObject; 68 void* m_ActivateCommand; 69 70 Description m_Description; 71 72 ResTexture m_Texture; 73 74 friend class IRenderTarget; 75 }; 76 77 } // namespace gfx 78 } // namespace nw 79 80 #endif // NW_GFX_OFFSCREENBUFFER_H_ 81