Monday, March 9, 2015

More on the UI

Duh, silly me, in my previous post I forgot that my routines in C were actually not in use anymore and was all pure python.

Then, I had some spare time to play around and get some hard data on my experiment, first let's describe a bit how that UI was done: basically win32 api's, it uses a LayeredWindow and AlphaBlend calls, this is because I wanted to see how far I could push it with plain old but well supported api's, also I wanted to have full per pixel alpha support on the root window (not just a global alpha value)
Another thing to consider, everything you saw in the video is a window (not a native Window, but my own defined window, again in python, the only real hwnd is of the root window): the title bar, each button, the background, even the scrollbars are composed of windows: the arrow buttons and the sliding block, all this was intentional as to exercise child windows and not a plain image with trickery.

In my notebook (i7 with a Radeon) the window that appears in the video is able to archive about 60 fps when resizing (just a small change in it to force a full redraw) with a close size to 1366x768, this is with no alpha pixels in the background while there are ones in the scrollbar.
Performance gets tricky here, if most of the background has alpha value (so you can see beneath it) then performance varies depending on how many pixels, it went as low as 45 fps.

Then, I made another 'driver' to suppress the alpha blending at all, so everything is opaque, while still paints over a LayeredWindow all the image ops are FillRect and BitBlt, also the call to UpdateLayeredWindow using ULW_OPAQUE, at this point the frame rate went all the way up to 120 fps, quite a speed boost.

Yet, I should try (whenever I can find the time) to use one driven by directx and possibly opengl too, i'm not too anxious to try the opengl one but I may do so.

Having said all that, it is important to remember that 60 fps is a lot for a commercial application (not for a game) and that 99.9% of the time for an application the redraw is usually a minimal part of the window.

Well then, I'm not sure if / when I'll continue with this experiment, i'm itchy about knowing the potential FPS with directx but no promises, I may or may not try it out

Hope it is of any use to some adventurous soul

-Mat




No comments:

Post a Comment