Home › Forums › Breakaway Professional Products – [discontinued] › OpenGL – DirectX
- This topic has 4 replies, 2 voices, and was last updated 13 years, 7 months ago by Vincent.
-
AuthorPosts
-
April 5, 2011 at 10:04 am #1083VincentMember
Does anyone know how the oscilloscope and level meters are drawn on the screen? Does Leif use OpenGL or DirectX for this?
I noticed that when I minimize Breakaway in the toolbar the CPU usage decreases..?? It looks like the painting job is very time consuming..
April 5, 2011 at 1:03 pm #12071JesseGMemberIt is somewhat hardware accelerated, if your GPU & drivers support it. The parts of the GUI are totally custom, but it is drawing them into "hacked" standard Windows controls, combined with GDI/GDI+ blitting using transparent PNGs for the shape (decoded only once ofc), and GDI/GDI+ for text and primitives rendering. The scope I believe is completely custom, and the only thing from GDI/GDI+ is the blit (Bltblt) to the screen. The "brushed steel" is procedurally created, so every time you run Breakaway you get different steel. 8) Everything was optimized to only render/draw something if it changed or was required.
Just the same… the new GUI framework is much more efficient, because it’s completely custom. The only thing Windows really handles is the Blit to the Window… and any tool tips also are drawn into Windows that get created for them. (without any system menu or toolbar etc, ofc)
Hopefully that answered your question, not too technically.
April 5, 2011 at 2:33 pm #12072VincentMemberHmm.. I can’t believe the scope is drawn by the GPU because both GDI and GDI+ does all the tricky parts by CPU (Software rendering) (antialiasing, blending, etc,etc) DirecX (Direct2d, Direct3d) and OpenGL does all the tricky stuff inside the GPU (if available). But if GDI or GDI+ does all the drawing and the drawed bitmap is BitBlit from Memory DC to the Window DC then the drawing is purely done by the CPU.
Even though the drawing takes a big amount of processing power, I’m totally surprised that GDI+ performs so well. It runs very smoothly!
Well done!
April 6, 2011 at 3:27 am #12073JesseGMemberEverything in GDI/GDI+ that could be accelerated by the GPU (more than you think) was done a while ago. Since the nVidia GeForce 3, and ATi Radeon 8500. They both have extensive documentation about it. There are some limitations of course, mainly when working with large amounts of textures and system memory. Or an exceptionally large primitives list, perhaps. Luckily Breakaway doesn’t use much textures, compared to a video game from even 10 years ago.
Other than a few tweaks with Flex Meters, I’ve had nothing to do with the graphics sans a bit of advice early on. So all thanks to Leif. 8)
Cheers
April 12, 2011 at 8:45 am #12074VincentMemberThanks for the info Jesse,
The last few days I have build my own DPO using OpenGL. I have written the DPO algorithm myself using a 3 dimensional buffer with x,y,z values.
Z represents a 16 level deep brightness buffer. Each time a waveform is captured it is stored in the 3 dimensional buffer.
Each time a pixel is hit the Z value increases. A separated thread clears the Z buffers and fades out the captured waveforms.The first version used GDI with double buffering but it was way to slow! The SetPixel function was eating the CPU power.
The LineTo function could not be used in a real DPO. With OpenGL the problem was fixed.
I have set the framerate to 10mS and the CPU is only using 3% on my Pentium 3000 with 2GB RAM. -
AuthorPosts
- The forum ‘Breakaway Professional Products – [discontinued]’ is closed to new topics and replies.