Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 07 Apr 2010 03:30:59 -0000
The following error is produce if the code below is used when the button is clicked the second time (to change the display from Full Screen to Windowed): "Cannot use this function while display is closed!" "In function: Wait Event"
@DISPLAY {Width=640, Height=480, Color = #WHITE, Title = "Test", Layers=True}
CreateDisplay(2, {Width=200, Height=300})
SetFillStyle(#FILLCOLOR)
Box(0, 0, 50, 50)
Function p_ButtonFunc()
ChangeVar=Not ChangeVar
If ChangeVar=1
ChangeDisplayMode(#DISPMODE_FULLSCREEN, 640, 480)
OpenDisplay(2)
Else
ChangeDisplayMode(#DISPMODE_WINDOWED)
Wait(200); This is added to show that the Display Mode has changed without problem before the error.
CloseDisplay(2)
EndIf
EndFunction
ButtonTable={OnMouseUp=p_ButtonFunc}
MakeButton(1, #LAYERBUTTON, 1, False, True, ButtonTable)
Repeat
WaitEvent
Forever
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 11 Apr 2010 22:01:50 +0200
The following error is produce if the code below is used when the button is clicked the second time (to change the display from Full Screen to Windowed): "Cannot use this function while display is closed!" "In function: Wait Event"
It's not a bug WaitEvent() currently doesn't work if the active display is closed. Thus, you need to make your first display active again after closing the second one, i.e.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 11 Apr 2010 22:53:30 -0000
That solved one problem, but there is still another one. Using the following code works the first time the display is changed to full screen, but if you try it again, the following error occurs: "Unable to change display size to 200x300" Apparently it is trying to make the second windowed display full screen as well.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 13 Apr 2010 22:29:41 +0200
That solved one problem, but there is still another one. Using the following code works the first time the display is changed to full screen, but if you try it again, the following error occurs: "Unable to change display size to 200x300" Apparently it is trying to make the second windowed display full screen as well.
Hmm, ok, this seems to be a bug. I'll fix this.
Just one word on your code: Using multiple displays in full screen mode is definitely not recommended. Hollywood currently doesn't forbid this, but it's somewhat likely that it will no longer work in future versions. In full screen mode there generally should be only one display. On Amiga, multiple displays will work fine in full screen mode because of the Amiga's unique screen concept but on Windows and Mac OS X there's really a good chance of running into trouble when trying to work with multiple displays in full screen mode because full screen mode might overtake the system completely with no access to the window manager at all. Hollywood might even lock the video buffer and draw to it directly in full screen mode in future versions. Thus, you should avoid working with multiple displays in full screen mode except if you are only targetting Amiga compatibles.
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 13 Apr 2010 23:07:42 +0200
That solved one problem, but there is still another one. Using the following code works the first time the display is changed to full screen, but if you try it again, the following error occurs: "Unable to change display size to 200x300" Apparently it is trying to make the second windowed display full screen as well.
You get the error because display #2 does not entirely fit into the 640x480 screen bounds (because in windowed mode it is in the center of the screen, thus on a 1280x1024 screen it would have the coordinates of 535|344 or something). Displaying a 320x200 window at 535|344 on a 640x480 will have parts of the display off screen, that is why Hollywood is complaining. So to cut this short, just move the display #2 to 0,0 or something and it will work