Hi, I have a problem, when wanting to change the display dimentions dynamically and starting my program in fullscreen.
I don't use 'mode=ask' in the @DISPLAY preprocessor command because I want to remember the chosen dimensions in a table. So here is my code:
Code: Select all
@DISPLAY 1,{ Color = #BLACK, Title = #DEFAPPTITLE, hidden=True /*, mode = "ask"*/ }
Local screenmodesT=GetDisplayModes()
Local modesT={}
modesT[0]=screenmodesT[0].width.."x"..screenmodesT[0].height
Local midx=-1
For Local i=1 To ListItems(screenmodesT)-1
modesT[i]=screenmodesT[i].width.."x"..screenmodesT[i].height
If (screenmodesT[i].width=SETTINGST["width"] and screenmodesT[i].height=SETTINGST["height"]) Then midx=i
Next
Local res=ListRequest("Chose Screenmode","Available Screenmodes:",modesT,midx)
If (res>=0)
Local chosenT,count=SplitStr(modesT[res],"x")
SETTINGST["width"]=Val(chosenT[0])
SETTINGST["height"]=Val(chosenT[1])
EndIf
SetDisplayAttributes({width=SETTINGST["width"],height=SETTINGST["height"],Titel=SETTINGST["apptitle"]})
OpenDisplay(1)
When starting my program in fullscreen mode on the comandline with the option "-fullscreen" (or by the excellent hw4c plugin for Cubic IDE), the display cannot be opend in fullscreen mode for any resolution. The following error message appears:
"Kann die Displaygröße nicht auf 800x600 wechseln" (engl.: cannot change display size to 800x600).
When running in windows mode and using the RAMIGA-Return-shortcut, I *can* switch to fullscreen, up to a resolution 1280x1024 but not in 1600x1200.
So, i did not found any way to open a resolution 1920x1200. On Linux, by the way, it works up to 1400x900 (-- the max resolution of my laptop).
So, is this a bug or do I something wrong in my code?
Is there a better way to change the display resolution and to get the display dimension? By the way, "Getattribute(#DISPLAY,1,#ATTRWIDTH") gives me the default width "640" after the OpenDisplay(1) command. Seems wrong, isn't it?
cheers, nexus