|
Window redraw question |
|
ksattic (04:02 26/7/2003) john (10:20 26/7/2003) ksattic (06:10 27/7/2003) john (10:40 27/7/2003) ksattic (16:38 27/7/2003) cterran (17:43 27/7/2003) john (10:04 28/7/2003) john (17:57 27/7/2003) ksattic (18:16 27/7/2003)
|
|
Simon Wilson |
Message #44871, posted by ksattic at 04:02, 26/7/2003 |
Finally, an avatar!
Posts: 1291
|
Is there a good way for my application to determine which parts of its window are not covered by other windows?
I can do this by going through each window above my application's window in the stack and seeing how they intersect my window's area. However, how can my application be notified when a new window is opened on top of mine?
Thanks! |
|
[ Log in to reply ] |
|
John D |
Message #44872, posted by john at 10:20, 26/7/2003, in reply to message #44871 |
Member
Posts: 261
|
Why do you want to do this? If you use Wimp_ForceRedraw the wimp will send you a redraw request and you can then getrectangle and it will only give you the ones which need updating. You could actually do nothing in these (set your window to be transparent or the wimp will ckear the background) and then just remember the list of rectangles. In general, you shouldn't need to know what parts of your window are covered though. |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #44878, posted by ksattic at 06:10, 27/7/2003, in reply to message #44872 |
Finally, an avatar!
Posts: 1291
|
Why do you want to do this? For my TV card driver. I need to know as soon as the window becomes obscured so I can reprogram the TV card to not write parts of the image corresponding to the parts of the TV card window that become covered by other windows or menus. If this can't be done, then the TV card window will always have to be on top of the window stack.
Note: the way the TV card works is by copying image data directly into the video card's memory. Castle don't provide an overlay API for the Iyonix so I can't do that instead.
I thought about using your method but I would have to do this thousands of times a second to ensure that a newly opened menu or window isn't overwritten with TV image data. |
|
[ Log in to reply ] |
|
John D |
Message #44880, posted by john at 10:40, 27/7/2003, in reply to message #44878 |
Member
Posts: 261
|
Aha, I thought as much You could do the way I've seen in PCs, set the window colour to be black (/purple/yellow) and then just tell the card to fill in any area in that colour. It does mean that you can see odd bits on windows in front but it's not the end of the world? I am surprised by the thousands of times a second, surely it's less than 100 times a sec? |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #44885, posted by ksattic at 16:38, 27/7/2003, in reply to message #44880 |
Finally, an avatar!
Posts: 1291
|
You could do the way I've seen in PCs, set the window colour to be black (/purple/yellow) and then just tell the card to fill in any area in that colour. Unfortunately I would need an API for the NVidia card to do overlays, and that isn't available.
The thousands of times a second thing is because the TV card copies video data to the graphics card's memory asynchronously of anything RISC OS is doing, like window redrawing. It could be half way through drawing a frame when RISC OS draws a menu, meaning that I would have to check thousands of times a second to see if my window becomes obscured in order to stop the TV card from drawing any more pixels.
[Edited by ksattic at 17:38, 27/7/2003] |
|
[ Log in to reply ] |
|
Chris |
Message #44886, posted by cterran at 17:43, 27/7/2003, in reply to message #44885 |
Member
Posts: 163
|
Is the wimp filter system any use? There's a pre-rectangle draw hook.
Best, Chris |
|
[ Log in to reply ] |
|
John D |
Message #44888, posted by john at 17:57, 27/7/2003, in reply to message #44885 |
Member
Posts: 261
|
You might want to look at a module called WimpSWIVe, which will allow you to find out when windows and menus are opened. Of course sprite drags still won't be shown. |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #44889, posted by ksattic at 18:16, 27/7/2003, in reply to message #44888 |
Finally, an avatar!
Posts: 1291
|
Cheers Chris and John - I'll look into both of those! |
|
[ Log in to reply ] |
|
John D |
Message #44903, posted by john at 10:04, 28/7/2003, in reply to message #44886 |
Member
Posts: 261
|
I think the pre rectangle draw block is just when an application calls Wimp_GetRectangle, which won't be happening. |
|
[ Log in to reply ] |
|
|