dbSetWindowLayout(5,0,0);
That's a good idea.... thanks. I'll put that in as an option. I had a feeling that XP was the common issue. I would like others to confirm that. I would also like a developer to tell me what is different... Here is the entire code for my main menu:
bo
ol DoMainMenu(void){
if (dbCheckDisplayMode (ScreenW, ScreenH, 32 )==0){
ScreenD=16;
}
dbSetDisplayMode (ScreenW, ScreenH, ScreenD );
dbSetWindowLayout ( 0, 0, 0 );
dbMaximizeWindow ( );
dbSyncOn( );
dbHideMouse();
dbAutoCamOff();
MainGUI.InitMenuGUI("",1000,0,0,"MainGUI.MNU");
//populate the resolutions available
dbPerformChecklistForDisplayModes();
int ND=dbGetNumberOfDisplayModes();
int SettingsButton=MainGUI.GetMenuItemNumber("SettingsButton");
int ExitGameButton=MainGUI.GetMenuItemNumber("ExitGameButton");
int NewGameButton=MainGUI.GetMenuItemNumber("NewGameButton");
int ResolutionList=MainGUI.GetMenuItemNumber("ResolutionList");
int DoneButton=MainGUI.GetMenuItemNumber("DoneButton");
int LeftHandedMouseButton=MainGUI.GetMenuItemNumber("LeftHandedMouseButton");
int SettingsTabMenu=MainGUI.GetMenuItemNumber("SettingsTabMenu");
if (ND>49) ND=49;
int CurrentDisplayMode=-1;
char FF[60];
for (int i=1;i<ND;i++){
dbGetDisplayMode(i,tmpString);
//break down into whd
char *C;
strcpy(FF,tmpString);
C=strtok(FF," x ");
int SW=dbVal(C);
C=strtok(NULL," x ");
int SH=dbVal(C);
C=strtok(NULL," x ");
int SD=dbVal(C);
if (SW>=1024) MainGUI.AddToList(ResolutionList,tmpString);
if ((SW==ScreenW)&&(SH==ScreenH)&&(SD==ScreenD)) CurrentDisplayMode=MainGUI.MenuItem[ResolutionList].TextBox[0].MaxLines-1;
}
MainGUI.MenuGroup[0].LX=ScreenW/2-MainGUI.MenuGroup[0].SizeX/2;
MainGUI.MenuGroup[0].LY=ScreenH/2-MainGUI.MenuGroup[0].SizeY/2;
MainGUI.MenuGroup[1].LX=ScreenW/2-MainGUI.MenuGroup[1].SizeX/2;
MainGUI.MenuGroup[1].LY=ScreenH/2-MainGUI.MenuGroup[1].SizeY/2;
//************** LOAD GAME PREFERENCES ********************
MainGUI.MenuItem[ResolutionList].TextBox[0].CursLocY=CurrentDisplayMode;
int BitmapImage=1;
strcpy(FilePath,StartPath);
strcat(FilePath,"\\..\\Images\\backdrop1.jpg");
dbLoadImage (FilePath,BitmapImage);
dbSprite(BitmapImage,0,0,BitmapImage);
dbSizeSprite(BitmapImage,ScreenW,ScreenH);
dbHideSprite(BitmapImage);
dbSetSpriteAlpha (BitmapImage,255);
dbSetSprite (BitmapImage,0,0);
MainGUI.MenuGroup[0].ShowGroup=true;
bool EnterGame=false;
bool ExitGame=false;
while ((!EnterGame)&&(!ExitGame)){
dbPasteSprite(BitmapImage,0,0);
MainGUI.ShowGUI();
dbPasteSprite(MainGUI.MouseSprite,dbMouseX(),dbMouseY());
// dbText(0,0,tmpString);
// dbText(0,20,dbStr(tp1));
dbSync();
if (MainGUI.MenuItem[NewGameButton].State==1){
EnterGame=true;
}
if ((MainGUI.MenuItem[ExitGameButton].State==1)||(dbEscapeKey ()==1)){
ExitGame=true;
}
if (MainGUI.MenuItem[SettingsButton].State==1){
MainGUI.MenuItem[SettingsButton].State=0;
MainGUI.MenuGroup[0].ShowGroup=false;
MainGUI.MenuGroup[1].ShowGroup=true;
MainGUI.MenuGroup[MainGUI.MenuItem[SettingsTabMenu].Tabs[MainGUI.MenuItem[SettingsTabMenu].ListItemSelected].GroupToBringUp].ShowGroup=true;
MainGUI.SetGroupToTop(MainGUI.MenuItem[SettingsTabMenu].Tabs[MainGUI.MenuItem[SettingsTabMenu].ListItemSelected].GroupToBringUp);
}
if (MainGUI.MenuItem[DoneButton].State==1){
MainGUI.MenuItem[DoneButton].State=0;
for (int i=0;i<10;i++) MainGUI.MenuGroup[i].ShowGroup=false;
MainGUI.MenuGroup[0].ShowGroup=true;
}
if (CurrentDisplayMode!=MainGUI.MenuItem[ResolutionList].TextBox[0].CursLocY){
CurrentDisplayMode=MainGUI.MenuItem[ResolutionList].TextBox[0].CursLocY;
}
if (MainGUI.MenuItem[LeftHandedMouseButton].State==1){
RightMouseClick=1;
LeftMouseClick=2;
}
else{
RightMouseClick=2;
LeftMouseClick=1;
}
}
//break down into whd
char *C;
strcpy(FF,MainGUI.MenuItem[ResolutionList].TextBox[0].StringList[CurrentDisplayMode]);
C=strtok(FF," x ");
ScreenW=dbVal(C);
C=strtok(NULL," x ");
ScreenH=dbVal(C);
C=strtok(NULL," x ");
ScreenD=dbVal(C);
MainGUI.UnloadMenuGUI();
dbDeleteSprite(BitmapImage);
dbDeleteImage(BitmapImage);
if (ExitGame) return false;
else return true;
}
If you followed my GUI posts, you may recognize that MainGUI is a pointer for my GUI class. It's immaterial to this problem; just know that the "MainGUI.MenuItem[ResolutionList]" part holds the available resolutions discovered by dbPerformChecklistForDisplayModes();
As I said earlier, I can't do anything to change the code right now, because I'm not at my programming PC. If someone sees something wrong with my code, please let me know so I can fix it(in about a week). Thanks.
The fastest code is the code never written.