1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_OnScreenBuffer.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_ONSCREENBUFFER_H_
17 #define NW_GFX_ONSCREENBUFFER_H_
18 
19 #include <nw/gfx/gfx_IRenderTarget.h>
20 #include <nw/ut/ut_Preprocessor.h>
21 
22 namespace nw
23 {
24 namespace os
25 {
26 class IAllocator;
27 } // namespace os
28 
29 namespace gfx
30 {
31 
32 //---------------------------------------------------------------------------
33 //! @brief        画面に表示させるための描画対象を表すクラスです。
34 //---------------------------------------------------------------------------
35 class OnScreenBuffer : public IRenderTarget
36 {
37 private:
38     NW_DISALLOW_COPY_AND_ASSIGN(OnScreenBuffer);
39 
40 public:
41     NW_UT_RUNTIME_TYPEINFO;
42 
43     //! 設定内容を取得します。
GetDescription()44     virtual const Description& GetDescription() const { return m_Description; }
45 
46     //---------------------------------------------------------------------------
47     //! @brief        バッファオブジェクトを取得します。
48     //!
49     //! @return       バッファオブジェクトを返します。
50     //---------------------------------------------------------------------------
GetBufferObject()51     virtual const FrameBufferObject& GetBufferObject() const { return m_BackBufferObject; }
52 
53 private:
54     //! @brief        コンストラクタです。
55     OnScreenBuffer(os::IAllocator* pAllocator, const Description& description);
56 
57     void InitializeGl();
58     void InitizlizeManulally();
59 
60     //! @brief        デストラクタです。
61     virtual ~OnScreenBuffer();
62 
63     u32 m_ColorBuffer;
64     u32 m_DepthBuffer;
65     FrameBufferObject m_BackBufferObject;
66 
67     Description m_Description;
68 
69     friend class IRenderTarget;
70 };
71 
72 } // namespace gfx
73 } // namespace nw
74 
75 #endif // NW_GFX_ONSCREENBUFFER_H_
76