1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #if !defined(AFX_TEXTURE_CHOOSER_H__FE10F78E_0B69_4EB0_8FC7_A48FAEB904FD__INCLUDED_)
18 #define AFX_TEXTURE_CHOOSER_H__FE10F78E_0B69_4EB0_8FC7_A48FAEB904FD__INCLUDED_
22 #endif // _MSC_VER > 1000
23 // texture_chooser.h : header file
27 #include "edit_attrib_dlg.h"
28 #include "popup_notify.h"
29 #include "ps_wrapper.h"
30 #include "particle_workspace.h"
32 #include "nel/misc/smart_ptr.h"
34 #include "nel/3d/texture.h"
36 using NLMISC::CSmartPtr
;
40 class CPSMultiTexturedParticle
;
46 /////////////////////////////////////////////////////////////////////////////
47 // CTextureChooser dialog
49 class CTextureChooser
: public CEditAttribDlg
, IPopupNotify
53 // construct the object with the given texture
54 CTextureChooser(NL3D::CPSMultiTexturedParticle
*mtp
, CParticleWorkspace::CNode
*ownerNode
); // standard constructor
58 /// when initing, you can also provide a point to a mutltitextured particle
59 virtual void init(uint32 x
, uint32 y
, CWnd
*pParent
= NULL
) ;
61 BOOL
EnableWindow( BOOL bEnable
);
63 // set a wrapper to get the datas
64 void setWrapper(IPSWrapperTexture
*wrapper
) { _Wrapper
= wrapper
; }
67 /// enable to remove texture. the default is false
68 void enableRemoveButton(void) { _EnableRemoveButton
= true ; }
70 //{{AFX_DATA(CTextureChooser)
71 enum { IDD
= IDD_TEXTURE_CHOOSER
};
72 CButton m_MultiTexCtrl
;
77 // ClassWizard generated virtual function overrides
78 //{{AFX_VIRTUAL(CTextureChooser)
80 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
85 bool _EnableRemoveButton
;
86 CParticleWorkspace::CNode
*_Node
;
87 IPSWrapperTexture
*_Wrapper
;
88 NL3D::CPSMultiTexturedParticle
*_MTP
;
89 CMultiTexDlg
*_MultiTexDlg
;
90 // handle to the current bitmap being displayed
93 // update the current bitmap
94 void textureToBitmap() ;
96 // the current texture
97 CSmartPtr
<NL3D::ITexture
> _Texture
;
99 // Generated message map functions
100 //{{AFX_MSG(CTextureChooser)
101 virtual BOOL
OnInitDialog();
102 afx_msg
void OnPaint();
103 afx_msg
void OnRemoveTexture();
104 afx_msg
void OnEditMultitexturing();
105 afx_msg
void OnEnableMultitexturing();
106 afx_msg
void OnBrowseTexture();
108 DECLARE_MESSAGE_MAP() ;
110 /// inherited from IPopupNotify
111 void childPopupClosed(CWnd
*child
);
113 void updateMultiTexCtrl();
120 //{{AFX_INSERT_LOCATION}}
121 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
123 #endif // !defined(AFX_TEXTURE_CHOOSER_H__FE10F78E_0B69_4EB0_8FC7_A48FAEB904FD__INCLUDED_)