>>You could use string comparison to get the relevant values (GLenum) for the corresponding string identifier from the edit control.<<
if you mean somthing like (for example):
Code:
GLenum name;
char c_name;
c_name = getthetextfromthetextboxetc();
name = c_name;
CreateNewLight(name, posX, posY etc etc);
then i tried that and it diddn't work (light diddn't appear);
a listbox probably won't work in this particular situation.
If it helps, here is the code, tho it dosn't have anything done to get the 'name' value from the textbox (as nothing i tried worked ;P), and the name parameter in the CreateNewLight(); function is replaced with GL_LIGHT0, just so i could see if there was nothing wrong with the light code itself
Code:
BOOL CALLBACK LightInsertDlgProc(HWND hWnd, UINT Message, WPARAM wparam, LPARAM lparam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wparam))
{
case IDOK:
BOOL bSuccess1;
BOOL bSuccess2;
BOOL bSuccess3;
BOOL bSuccess4;
BOOL bSuccess5;
BOOL bSuccess6;
BOOL bSuccess7;
GLenum name;
float posX;
float posY;
float posZ;
float red;
float green;
float blue;
posX = GetDlgItemInt(hWnd, IDPOSXBOX, &bSuccess1, FALSE);
posY = GetDlgItemInt(hWnd, IDPOSXBOX, &bSuccess2, FALSE);
posZ = GetDlgItemInt(hWnd, IDPOSXBOX, &bSuccess3, FALSE);
red = GetDlgItemInt(hWnd, IDREDBOX, &bSuccess4, FALSE);
green = GetDlgItemInt(hWnd, IDGREENBOX, &bSuccess5, FALSE);
blue = GetDlgItemInt(hWnd, IDBLUEBOX, &bSuccess6, FALSE);
CreateNewLight(GL_LIGHT0, posX, posY, posZ, red, green, blue);
EndDialog(hWnd, IDCANCEL);
break;
case IDCANCEL:
EndDialog(hWnd, IDCANCEL);
break;
}
break;
default:
return FALSE;
}
return TRUE;
}
-psychopath