Clear screen to the green background ?

News,announcements,programming,fixes,game patches & discussions.
User avatar
thorsten.otto
Posts: 148
Joined: 04 Nov 2019 02:20

Re: Clear screen to the green background ?

Post by thorsten.otto »

exxos wrote: 25 Apr 2020 10:15 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: 28344
Joined: 16 Aug 2017 23:19
Location: UK

Re: Clear screen to the green background ?

Post by exxos »

thorsten.otto wrote: 25 Apr 2020 10:47 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.
User avatar
thorsten.otto
Posts: 148
Joined: 04 Nov 2019 02:20

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.
You do not have the required permissions to view the files attached to this post.
User avatar
exxos
Site Admin
Site Admin
Posts: 28344
Joined: 16 Aug 2017 23:19
Location: UK

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.


User avatar
thorsten.otto
Posts: 148
Joined: 04 Nov 2019 02:20

Re: Clear screen to the green background ?

Post by thorsten.otto »

exxos wrote: 25 Apr 2020 12:53 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.

Return to “SOFTWARE PROGRAMMING & DISCUSSION”

Who is online

Users browsing this forum: ClaudeBot and 3 guests