I implemented an AlphaHitWindow widget using http://cegui.org.uk/wiki/Hit_testing_of_non_rectangular_windows_with_CEGUI_0.7.x for 0.8.7 with minor changes to satisfy new function names.
While this class is a great and simple way to achieve non-rectangular windows, it has significant drawback: transparency and hit test is the same. To avoid this, I added a custom
Code: Select all
<PropertyDefinition name="HitTestRegion" type="Image"/>
to <WidgetLook name="TaharezLook/AlphaHitButton">.
This property is designated to keep hit-test information.
But I don't know a way to map it to a buffer except to render it once again. I think I miss something, because there is no need to "render" it - just copy it from
Code: Select all
to appropriate buffer. There is d_texture, d_area and other d_*s in protected area of CEGUI::Image class that give me the idea of straightforward copying. Moreover, I don't like the idea to render something in the CEGUI::RenderingSurface::EventRenderQueueEnded callback.
Should I make an inherited from CEGUI::Image wrapper class to expose d_*s mentioned above and use it to construct a buffer?
Should I render to texture (in Event callback or elsewhere)?
Is there another (sane) way to achieve alpha transparency decomposed from hit test?
---- Version: 0.8.7 (Build: Feb 3 2019 Debug Microsoft Windows MSVC++ Unknown MSVC++ version 64 bit) ----
---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based 2nd generation renderer module. TextureTarget support enabled via FBO extension. ----
---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
---- Scripting module is: None ----
If this is important, I use glfw-3.2.1 for OpenGL. MSVC version is Visual Studio Community 2017.
Thank you very much in advance.