Clear screen to the green background ?

News,announcements,programming,fixes,game patches & discussions.

Moderator: troed

User avatar
thorsten.otto
Posts: 148
Joined: Mon Nov 04, 2019 2:20 am

Re: Clear screen to the green background ?

Post by thorsten.otto »

exxos wrote: Sat Apr 25, 2020 10:15 am When I draw the menu box,
What menubox? I thought we are talking about dialog boxes here?
If I fill the screen with red for example
As already explained, you should not do that manually with VDI calls. If you absolutely need to, just install your own desktop using wind_set(0, WF_NEWDESK,..)
WM_REDRAW I'm not using as I don't think it would help.
But you said you opened a window. Ignoring WM_REDRAW messages there will surely leave all kinds of garbage on the screen.
User avatar
exxos
Site Admin
Site Admin
Posts: 23499
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Clear screen to the green background ?

Post by exxos »

thorsten.otto wrote: Sat Apr 25, 2020 10:47 am As already explained, you should not do that manually with VDI calls. If you absolutely need to, just install your own desktop using wind_set(0, WF_NEWDESK,..)
I tried all that yesterday, if anything it just seems to make the problem worse :(

This is what happens...






Of course if I just redraw the red background after FMD_FINISH problem is not visible. Will just have to do that until there is a better solution found.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
thorsten.otto
Posts: 148
Joined: Mon Nov 04, 2019 2:20 am

Re: Clear screen to the green background ?

Post by thorsten.otto »

There is one quirk when installing your own desktop that i forgot to mention. When you close your main dialog, then immediately open another dialog, you will immediately block the AES again, so it does not have time to see any redraw messages in order to redraw the background. You have to insert some even_multi() call in between. Also, don't forget to uninstall the desktop before exiting your program, otherwise the AES will still use that resource after exiting, but the memory it points to has been freed, resulting in crashes when you start the next program.

Attached is a small sample program for Pure-C that should work.
Attachments
flashy.zip
(9.29 KiB) Downloaded 179 times
User avatar
exxos
Site Admin
Site Admin
Posts: 23499
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Clear screen to the green background ?

Post by exxos »

Thanks yes that works. I do use evnt_multi For processing the buttons and clicks..

Though there is actually a delay added in my program anyway between dialogues... Is just to try and slow things down to a more consistent speed cross various platforms and processes. I use evnt_timer which is far as I know does not prevent the AES from processing background tasks.

Strictly speaking I do not need to check for WM_REDRAW, because I know exactly when I need to update the background, which is after the dialogue closes..

I only use the red colour to illustrate the problem, but now if I just redraw the background when dialogue closes, this all works fine across all OS versions..

In terms of all solid green background, the AES would re-draw it with the desktop hatched pattern...Same problem as in my previous video, just I used solid red instead of solid green...

Anyway, manually refreshing the background works as in the video below... I guess I could use WM_REDRAW, But it would only be calling the same "Clear background" routine anyway.


https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
thorsten.otto
Posts: 148
Joined: Mon Nov 04, 2019 2:20 am

Re: Clear screen to the green background ?

Post by thorsten.otto »

exxos wrote: Sat Apr 25, 2020 12:53 pm I do use evnt_multi For processing the buttons and clicks..
You can do that of course, but then you also have to manage some other things manually, like edit fields. A simple form_do() will usually be good enough.
there is actually a delay added in my program anyway between dialogues.
What for? your program will block anyway when processing the dialog.
Strictly speaking I do not need to check for WM_REDRAW, because I know exactly when I need to update the background, which is after the dialogue closes..
Strictly speaking you shouldn't directly draw to the desktop. It's not owned by you, but the AES.
I guess I could use WM_REDRAW
In your case, you can't. You won' get any WM_REDRAW message for the desktop, those are sent to the screen manager.

Just do yourself a favour, and do it cleanly. Its really not that difficult.
Post Reply

Return to “SOFTWARE PROGRAMMING & DISCUSSION”