Index: dxgltest/Tests3D.cpp |
— | — | @@ -1848,6 +1848,7 @@ |
1849 | 1849 | SendDlgItemMessage(hWnd,IDC_LIGHTTYPE,CB_ADDSTRING,0,(LPARAM)_T("Parallel Point"));
|
1850 | 1850 | SendDlgItemMessage(hWnd,IDC_LIGHTTYPE,CB_ADDSTRING,0,(LPARAM)_T("GL Spot"));
|
1851 | 1851 | SendDlgItemMessage(hWnd,IDC_LIGHTTYPE,CB_SETCURSEL,D3DLIGHT_DIRECTIONAL-1,0);
|
| 1852 | + SendDlgItemMessage(hWnd,IDC_LIGHTENABLED,BM_SETCHECK,BST_CHECKED,0);
|
1852 | 1853 | ::width = ddsd.dwWidth;
|
1853 | 1854 | ::height = ddsd.dwHeight;
|
1854 | 1855 | vertexshaderstate.texture = NULL;
|
— | — | @@ -2138,7 +2139,42 @@ |
2139 | 2140 | strupper(tmpstring); paddwordzeroes(tmpstring);
|
2140 | 2141 | SendDlgItemMessage(hWnd,IDC_LIGHTSPECULAR,WM_SETTEXT,0,(LPARAM)tmpstring);
|
2141 | 2142 | SendDlgItemMessage(hWnd,IDC_LIGHTTYPE,CB_SETCURSEL,lights[vertexshaderstate.currentlight].dltType-1,0);
|
| 2143 | + if(lightenable[vertexshaderstate.currentlight])
|
| 2144 | + SendDlgItemMessage(hWnd,IDC_LIGHTENABLED,BM_SETCHECK,BST_CHECKED,0);
|
| 2145 | + else SendDlgItemMessage(hWnd,IDC_LIGHTENABLED,BM_SETCHECK,BST_UNCHECKED,0);
|
2142 | 2146 | }
|
| 2147 | + break;
|
| 2148 | + case IDC_LIGHTENABLED:
|
| 2149 | + if(HIWORD(wParam) == BN_CLICKED)
|
| 2150 | + {
|
| 2151 | + if(SendDlgItemMessage(hWnd,IDC_LIGHTENABLED,BM_GETCHECK,0,0) == BST_CHECKED)
|
| 2152 | + {
|
| 2153 | + lightenable[vertexshaderstate.currentlight] = TRUE;
|
| 2154 | + d3d7dev->LightEnable(vertexshaderstate.currentlight,TRUE);
|
| 2155 | + }
|
| 2156 | + else
|
| 2157 | + {
|
| 2158 | + lightenable[vertexshaderstate.currentlight] = FALSE;
|
| 2159 | + d3d7dev->LightEnable(vertexshaderstate.currentlight,FALSE);
|
| 2160 | + }
|
| 2161 | + }
|
| 2162 | + break;
|
| 2163 | + case IDC_LIGHTTYPE:
|
| 2164 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 2165 | + {
|
| 2166 | + lights[vertexshaderstate.currentlight].dltType = (D3DLIGHTTYPE)
|
| 2167 | + (SendDlgItemMessage(hWnd,IDC_LIGHTTYPE,CB_GETCURSEL,0,0) + 1);
|
| 2168 | + d3d7dev->SetLight(vertexshaderstate.currentlight,&lights[vertexshaderstate.currentlight]);
|
| 2169 | + }
|
| 2170 | + break;
|
| 2171 | + case IDC_LIGHTRANGE:
|
| 2172 | + if(HIWORD(wParam) == EN_CHANGE)
|
| 2173 | + {
|
| 2174 | + SendDlgItemMessage(hWnd,IDC_LIGHTRANGE,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
|
| 2175 | + lights[vertexshaderstate.currentlight].dvRange = (float)_ttof(tmpstring);
|
| 2176 | + d3d7dev->SetLight(vertexshaderstate.currentlight,&lights[vertexshaderstate.currentlight]);
|
| 2177 | + }
|
| 2178 | + break;
|
2143 | 2179 | default:
|
2144 | 2180 | return FALSE;
|
2145 | 2181 | }
|