Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / 3d / object_viewer / day_night_dlg.cpp
blob84534c89736efce37312dfc9b5ab4c78dc0126ed
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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 // DayNightDlg.cpp : implementation file
20 #include "std_afx.h"
22 #include "object_viewer.h"
23 #include "day_night_dlg.h"
24 #include "nel/3d/water_pool_manager.h"
25 #include "nel/3d/nelu.h"
30 /////////////////////////////////////////////////////////////////////////////
31 // CDayNightDlg dialog
34 CDayNightDlg::CDayNightDlg(CObjectViewer *viewer, CWnd* pParent /*=NULL*/)
35 : CDialog(CDayNightDlg::IDD, pParent), _ObjView(viewer)
37 nlassert(viewer);
38 //{{AFX_DATA_INIT(CDayNightDlg)
39 //}}AFX_DATA_INIT
43 void CDayNightDlg::DoDataExchange(CDataExchange* pDX)
45 CDialog::DoDataExchange(pDX);
46 //{{AFX_DATA_MAP(CDayNightDlg)
47 DDX_Control(pDX, IDC_SCROLLBAR1, m_DayNightCtrl);
48 //}}AFX_DATA_MAP
52 BEGIN_MESSAGE_MAP(CDayNightDlg, CDialog)
53 //{{AFX_MSG_MAP(CDayNightDlg)
54 ON_WM_HSCROLL()
55 //}}AFX_MSG_MAP
56 END_MESSAGE_MAP()
58 /////////////////////////////////////////////////////////////////////////////
59 // CDayNightDlg message handlers
61 void CDayNightDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
63 if (nSBCode == SB_THUMBPOSITION || nSBCode == SB_THUMBTRACK)
65 UpdateData(TRUE);
66 if (pScrollBar == &m_DayNightCtrl)
68 _ObjView->getWaterPoolManager().setBlendFactor(NL3D::CNELU::Driver, nPos * (1.f / 255.f) );
69 m_DayNightCtrl.SetScrollPos(nPos) ;
72 UpdateData(FALSE) ;
73 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
76 BOOL CDayNightDlg::OnInitDialog()
78 CDialog::OnInitDialog();
79 m_DayNightCtrl.SetScrollRange(0, 255);
80 return TRUE; // return TRUE unless you set the focus to a control
81 // EXCEPTION: OCX Property Pages should return FALSE