|
Use an external window handle |
tinyBigGAMES
Member #17,458
February 2020
|
Is it possible to tell allegro to use an existing window handle? I want to make some tools and have the rendering occur within the panel of this tool. Jarrod Davis |
Arthur Kalliokoski
Second in Command
February 2005
|
https://www.allegro.cc/manual/5/al_get_win_window_handle Teh mighty Google knows all, tells all. Took me 5 seconds. They all watch too much MSNBC... they get ideas. |
tinyBigGAMES
Member #17,458
February 2020
|
I don't mean get the created window handle, I mean, when I create a window, I need it to use and existing window handle. For example, you have a tool and you need rendering to occur within the bounds of your panel. In al_create_window for example, you pass the handle of that panel and rendering occurs in with it. al_create_window_from_handle(HWND handle) something like this, where instead of creating a new window, it will using and existing window. Update: Is there such a thing for allegro5? Jarrod Davis |
Arthur Kalliokoski
Second in Command
February 2005
|
Since the platform specific functions section only has al_get_win_window_handle() and a couple of iphone functions, I suspect not. You can't think of a way to do it the other way round, e.g. create an allegro window and call the window specific stuff to get the final result? I typed the above before I saw your edit, I don't know and haven't programmed in years. They all watch too much MSNBC... they get ideas. |
tinyBigGAMES
Member #17,458
February 2020
|
Well, I would design the tool visually. You see the 3 panels, I would need rendering to occur in the panel1. Each panel has an HWND handle, I would just need to pass this to allegro and rather than creating a whole window, it would use and existing one. Jarrod Davis |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Allegro cannot do this currently. That said, you have a few options. 1. Draw into your external HWND by locking an offscreen allegro window and blitting. This will be slow. 2. Perhaps you could create an allegro window over the panel and make the panel's HWND it's parent. It could be frameless and would draw over the top seamlessly. 3. Hack allegro to get it to do what you want. Allegro just isn't designed to render to an external HWND normally, because it takes over the window and manages it itself, which you probably don't want. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
tinyBigGAMES
Member #17,458
February 2020
|
Ok, understand. Thanks for reply. Jarrod Davis |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I think option #2 would be your best bet to try first, but I'm not familiar with parent child relationship in Windows windows. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Arthur Kalliokoski
Second in Command
February 2005
|
Edgar is the source of all good programming bits here. They all watch too much MSNBC... they get ideas. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
That's because there are like 5 of us left. :/ My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
RmBeer2
Member #16,660
April 2017
|
You don't need a handle of window where you have a display. EDIT: 🌈🌈🌈 🌟 BlackRook WebSite (Only valid from my installer) 🌟 C/C++ 🌟 GNU/Linux 🌟 IceCream/Cornet 🌟 🌈🌈🌈 Rm Beer for Emperor 2021! Rm Beer for Ruinous Slave Drained 2022! Rm Beer for Traveler From The Future Warning Not To Enter In 2023! Rm Beer are building a travel machine for Go Back from 2023! Rm Beer in an apocalyptic world burning hordes of Zombies in 2024! |
tinyBigGAMES
Member #17,458
February 2020
|
See this link: This is what I was asking about. Was there something like this, because I need allegro5 to render to an EXISTING window handle, not one that it manages internally. But it's apparent that allegro5 does not have this feature currently. I'm a coder so hacking one would not be an issue for me to try, but I don't know enough about how A5 works internally to get that working right now. Option #2, as pointed out seemed like it would be the next best option to try, however, the panel that is dropped on the form already has a fully initialized HWND handle and its managed internally. I don't see an easy way to make it use a different one as it managed by the VCL framework that controls it. Sigh. Jarrod Davis |
Edgar Reynaldo
Major Reynaldo
May 2007
|
No, you misunderstand option #2. Make the panel's HWND the parent of a frameless allegro window that you integrate seamlessly over the panel. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
tinyBigGAMES
Member #17,458
February 2020
|
I understand you, the problem is that when you drop a panel component on the form, internally it will create a handle and the Handle property only has a getter. It's managed internally by the VCL framework. In other words, by the time I have access to the panel properties, the win32 HWND handle for it has already been created and you can only reference it. Like Allegro5, it creates its own HWND internally. I may be able to make a custom panel where I can allow setting the handle. That's something else I can look into. Jarrod Davis |
Edgar Reynaldo
Major Reynaldo
May 2007
|
No, you still misunderstand. Create allegro window. Get its HWND. Get the external HWND of the panel using your getter. Call SetParent(eHWND) on the allegro window. UPDATE My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|