Automatic redraw of Windowed Screen

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Automatic redraw of Windowed Screen

Post by GPI »

Code: Select all

InitSprite()

If OpenWindow(1,0,0,800,600,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Test")
  If OpenWindowedScreen(WindowID(),0,0,800,600,#False,0,0)
    ClearScreen(255,255,255)
    FlipBuffers()
    MessageRequester("Test","test")
  EndIf
EndIf
Move the Message-Requester-Window: You will earse the WindowedScreen with the default window background color.
It would be nice, when PB automatic redraw the windowed-Screen (it exist in one of the two buffers, so it should be no problem).

Maybe optional with (for possible Speed-Problems)

WindowedScreenRedraw(Flag)
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: Automatic redraw of Windowed Screen

Post by tinman »

You can add a section of code in your event handler like this (it is what I currently do):

Code: Select all

    ev.l = WaitWindowEvent()
    Select ev
        Case #PB_Event_Repaint
            FlipBuffers() : FlipBuffers()
    EndSelect
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: Automatic redraw of Windowed Screen

Post by GPI »

tinman wrote:You can add a section of code in your event handler like this (it is what I currently do):

Code: Select all

    ev.l = WaitWindowEvent()
    Select ev
        Case #PB_Event_Repaint
            FlipBuffers() : FlipBuffers()
    EndSelect
First: A very bad workaround, because the wrong Buffer can flash for milliseconds on screen. and second: Don't work, because the main-program is "catched" by the messageRequester().
Post Reply