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