Go to the source code of this file.
Functions | |
UINT APIENTRY | ColorDialogHook (HWND hdlg, UINT msg, WPARAM, LPARAM) |
void | GetLightColor () |
|
Definition at line 8 of file winfuncs.cpp. References DialogInUse, FALSE, and TRUE. Referenced by GetLightColor().
00009 { 00010 switch (msg) 00011 { 00012 case WM_INITDIALOG: 00013 { 00014 if(DialogInUse == 1) // Ambient 00015 SetWindowText(hdlg, "Choose Ambient Color"); 00016 if(DialogInUse == 2) // Diffuse 00017 SetWindowText(hdlg, "Choose Diffuse Color"); 00018 if(DialogInUse == 3) // Specular 00019 SetWindowText(hdlg, "Choose Specular Color"); 00020 return TRUE; 00021 } 00022 00023 default: 00024 return FALSE; 00025 } 00026 } |
|
Definition at line 28 of file winfuncs.cpp. References ColorDialogHook(), hWnd, and lightColor.
00029 { 00030 COLORREF colors[16]; 00031 COLORREF colorRGB = RGB(lightColor[0]*255, lightColor[1]*255, lightColor[2]*255); 00032 CHOOSECOLOR colorDialog; 00033 memset(&colorDialog,0,sizeof(colorDialog)); 00034 memset(colors,255,sizeof(colors)); 00035 colorDialog.lStructSize = sizeof(CHOOSECOLOR); 00036 colorDialog.hwndOwner = hWnd; 00037 colorDialog.rgbResult = colorRGB; 00038 colorDialog.lpCustColors = colors; 00039 colorDialog.Flags = CC_FULLOPEN | CC_RGBINIT | CC_ENABLEHOOK; 00040 colorDialog.lpfnHook = (LPCCHOOKPROC)ColorDialogHook; 00041 ChooseColor(&colorDialog); 00042 lightColor[0] = (float)GetRValue(colorDialog.rgbResult)/255; 00043 lightColor[1] = (float)GetGValue(colorDialog.rgbResult)/255; 00044 lightColor[2] = (float)GetBValue(colorDialog.rgbResult)/255; 00045 } |