DGL https://delphigl.com/forum/ |
|
Single Rendering Context On MDI Application https://delphigl.com/forum/viewtopic.php?f=19&t=8919 |
Seite 1 von 1 |
Autor: | Dave Blake [ Di Jan 05, 2010 13:39 ] |
Betreff des Beitrags: | Single Rendering Context On MDI Application |
I want to use OpenGL graphics on subregions of both dialog forms and child forms of a MDI application. I have a multiple rendering context version working, rendering onto TPanels on both kinds of form and calling wglMakeCurrent frequently to activate/deactivate appropriately. I use wglShareLists so that textures are common to all rendering contexts. I was very happy at getting this all working when I discovered that a number of Intel graphics drivers fail to deal with wglShareLists. ![]() Can anyone suggest how I achieve this? My idea is to render to single window positioned to match the region of the active child form (or dialog box), and bitblt this to a bitmap as each child deactivates. The non-active forms thus display a bitmap image of the rendering. Initially I tried using a Tpanel on the main form as the OGL window, which paints infront of the MDI child forms but I have to "cut" a hole in the diaglog boxes to show it. Then I used a borderless form shown SW_SHOWNOACTIVATE and setting the WMNCHitTest message result to HTTRANSPARENT to prevent mouse clicks giving it focus. Where my idea runs into difficulty is with floating toolbars etc. I need to manage the zorder of the OGL window so that it is temporarily topmost before the bitblt, then located just infront of the form it is rendering so floating toolbars etc. are painted infront of it. Managing the zorder is giving me problems. And perhaps using a form provides more funcationality than I need. Maybe a simple control, something more like a THintWindow, would be better? Long question I know, but interesting (I hope) and a good solution would have all kinds of uses. |
Autor: | Stucuk [ Mi Jan 06, 2010 06:39 ] |
Betreff des Beitrags: | Re: Single Rendering Context On MDI Application |
If you don't mind doing a bit of coding you could just create your own GUI system complete with forms, etc. That way everything would be rendered in one opengl context. But look like they are multiple windows. I.E http://www.youtube.com/watch?v=CUdDxJbPkN8 |
Autor: | Dave Blake [ Mi Jan 06, 2010 09:41 ] |
Betreff des Beitrags: | Re: Single Rendering Context On MDI Application |
Just a bit of coding..... You know I have thought about a home-made MDI, but I like the consistency of how standard Windows controls work (especially all the keyboard control, short cuts etc.) and reproducing all that does seem rather a lot of work. Your example looks very nice too, just how much work was that? If I needed simultaneous movement in separate windows like that then it would be the way to go. But only the active window needs rendering for animation, bitmaps would do for the rest. It is a bit like wanting OpenGL rendered labels or buttons throughout a standard GUI application, I have been looking for examples of that to borrow ideas from. I am almost there with my approach, if only I coud control the z-order better. It seems once I have made a window topmost, I am unable to return it to the previous z-order just infront the active child form, but behind any floating toolbars or normal (non-child) forms etc. The mysteries of SetWindowPos. |
Autor: | Stucuk [ Mi Jan 06, 2010 12:30 ] |
Betreff des Beitrags: | Re: Single Rendering Context On MDI Application |
The example link i posted's code was more complex than it needed to be(Instead of having everything based off of one Basic GUI element it had separate stuff which wasted alot of code on doing the same thing in another object). With the latest GUI system i made (Which has no z-order, tho z-order isnt hard to add) it proberly took about a week or so max. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |