/**
    Copyright (c) 2010 yakiimo02
    Distributed under the New BSD License.
    See included license.txt or http://www.yakiimo3d.com/NewBSDLicense.txt
**/

#pragma once

#include "DXUTgui.h"            // CDXUTDialogResourceManager
#include "SDKmisc.h"            // CDXUTTextHelper
#include "DXUTsettingsdlg.h"    // CD3DSettingsDlg

/**
    @brief  GUI
    @author yakiimo02
    @date   2010/09/24
*/
class GUI
{
public:
    GUI();

    void    RegistGuiItems();
    HRESULT Create( ID3D11Device* pd3dDevice );
    bool    FrameRender( float fElapsedTime );
    HRESULT ResizedSwapChain( ID3D11Device* pd3dDevice, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
    void    Destroy();
    void    ReleasingSwapChain();

    LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool* pbNoFurtherProcessing );

    inline void SetbDisplayGUI( bool bDisplayGUI ) { m_bDisplayGUI = bDisplayGUI; }
    inline bool GetbDisplayGUI() const { return m_bDisplayGUI; }

    inline CD3DSettingsDlg&        GetrSettingsDlg()    { return m_D3DSettingsDlg; }

protected:
    void RenderText();

protected:
    CDXUTDialogResourceManager  m_DialogResourceManager;      // Manager for shared resources of dialogs
    CDXUTTextHelper*            m_pTxtHelper;                 // For drawing text
    CDXUTDialog                 m_SampleUI;                   // Dialog for sample specific controls
    CDXUTDialog                 m_HUD;                        // dialog for standard controls
    CD3DSettingsDlg             m_D3DSettingsDlg;             // Device settings dialog

    bool                        m_bDisplayGUI;                // Whether to display gui

    // temporal aa
    CDXUTComboBox*             m_pTemporalAAModeComboBox;     // Whether temporal aa combobox
};

extern GUI g_gui;