log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- 10 RISC OS gift ideas for Christmas (News:)
- Drag'N'Drop Autumn edition now available (News:)
- !DualHead puts 2 screens in one (News:)
- RISC OS London Show 2017 - Notes from the talks (News:6)
- November News (News:)
- !Organizer 2.28 reviewed (News:2)
- !OBrowse reviewed (News:10)
- Aemulor (Gen:16)
- DDE reaches release 28 and above (News:)
- Elesar quicks dispels stormy clouds (News:2)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
The Icon Bar: Programming: Returning from full screen mode
 
  Returning from full screen mode
  MrTAToad (13:22 10/2/2013)
  swirlythingy (18:13 10/2/2013)
    MrTAToad (22:36 10/2/2013)
      swirlythingy (23:56 10/2/2013)
        MrTAToad (11:11 12/2/2013)
 
Nicholas Kingsley Message #121889, posted by MrTAToad at 13:22, 10/2/2013
Member
Posts: 36
In my routine at start I store the current screen resolution mode (old stylee or new type) which is then used by the code to supposedly revert back to the correct mode when the program ends (using Wimp_SetMode). However, I find that often the program (or system) hangs with just the mouse pointer visible.
  ^[ Log in to reply ]
 
Martin Bazley Message #121890, posted by swirlythingy at 18:13, 10/2/2013, in reply to message #121889

Posts: 460
Is that necessary? If you don't call Wimp_Initialise, then I think the Wimp will buffer the current state of the screen, including mode, and restore it all for you when you 'press SPACE or click mouse to continue'.

And I'm pretty sure that Wimp_SetMode is what you call to change the desktop's screen mode, and I'm not certain what happens if you call it outside the Wimp. Wouldn't OS_ScreenMode 0 be a better bet?

Also, are you using double-buffering? That's a whole extra set of complications.
  ^[ Log in to reply ]
 
Nicholas Kingsley Message #121891, posted by MrTAToad at 22:36, 10/2/2013, in reply to message #121890
Member
Posts: 36
Yes, double buffering is used.

If the WIMP does restore the desktop properly then a manual restore wont be needed - will have to try that.
  ^[ Log in to reply ]
 
Martin Bazley Message #121892, posted by swirlythingy at 23:56, 10/2/2013, in reply to message #121891

Posts: 460
Double buffering is evil. See this thread.

I initially tried to store the desktop screen mode and attempt to switch back, but I later found out how to do it properly. I advise you examine the code used in the current release of Magic Mushrooms. That also shows you how to force the OS to allocate enough memory for two screen buffers, which is harder than it sounds. Without sufficient memory, requests to switch to the second screen bank will simply be ignored.
  ^[ Log in to reply ]
 
Nicholas Kingsley Message #121900, posted by MrTAToad at 11:11, 12/2/2013, in reply to message #121892
Member
Posts: 36
Thanks for that.

I need to look and see why the system is hanging on program end first - I remove the Wimp call, so it must be something in my destructors...
  ^[ Log in to reply ]
 

The Icon Bar: Programming: Returning from full screen mode