Comments (9)
I tested it and it seems to be working for me (Windows 11, x64).
I have however now confirmed that it breaks with io.ConfigWindowsMoveFromTitleBarOnly = true
in the same way as your repeated capture. Seems fixable.
(Initially we designed/created the capture tool to work completely outside of Test Engine, which required some hoops and design choices which i think may be irrelevant today. It may be a good idea to rewrite it and embrace using test engine.)
As for one failing under Windows: which backend you are using?
You my add breakpoint in imgui_app.cpp's ImGuiApp_ScreenCaptureFunc() to investigate further.
from imgui_test_engine.
I have however now confirmed that it breaks with io.ConfigWindowsMoveFromTitleBarOnly = true in the same way as your repeated capture. Seems fixable.
Good catch! I if set io.ConfigWindowsMoveFromTitleBarOnly = false, then it works
I was getting this issue from inside HelloImGui, where io.ConfigWindowsMoveFromTitleBarOnly is false by default. I'll soon post an issue inside HelloImGui and give some details about how it is going. If you want to give me some output it would be appreciable!
Now, getting on to debug under windows
from imgui_test_engine.
Under windows, I have found the issue: I'm using the docking branch, and this code inside app_minimal_main.cpp is the reason it fails:
#ifdef IMGUI_HAS_VIEWPORT
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
#endif
If I comment out this line, then it works! I think your implementation mentions somewhere that viewports are not handled for screen capture.
from imgui_test_engine.
-
I fixed the issue with
io.ConfigWindowsMoveFromTitleBarOnly
and stitching. -
ImGuiCaptureFlags_StitchAll doesn't currently work with multi-viewport because the way we move the window makes it move to its own viewport whereas we try to capture from the main viewport. I however pushed changes to support capturing from secondary viewport in imgui_app (the API was already there but not supported by imgui_app), but it requires further changes in capture tool too.
from imgui_test_engine.
I fixed the issue with io.ConfigWindowsMoveFromTitleBarOnly and stitching
I confirm that your fix works
from imgui_test_engine.
I put a little more effort on trying to fix various things with the capture tool, but I believe the codebase is too flawed, it may be simpler to rewrite with specialized/separate function for single capture, stitched capture, video capture etc. and test support for viewport and DPI shenanigans.
from imgui_test_engine.
It happens to all of us :-)
May be adding simple structs to store a capture and its coords such as below could help to make the API a bit simpler.
struct ImageBufferRgba
{
int Width = 0, Height = 0;
ImVector<uint8_t> Buffer;
};
struct CaptureCoords
{
ImGuiID ViewportId;
int x, int y, int w, int h; // Or maybe ImRect
};
with the added benefits that:
- transforming CaptureCoords into new coords taking into account FrameBufferScale now becomes easier
- resizing ImageBufferRgba.Buffer can be done when needed (i.e. at the moment of the capture). Signalling that the image buffer size differs from the window size becomes also possible.
And the callback signature could then become:
typedef bool (ImGuiScreenCaptureFunc)(CaptureCoords coords, ImageBufferRgba* buffer, void* user_data);
However, this would probably change too much user code for those who already implemented a callback.
from imgui_test_engine.
... and there are probably lots of other reasons for which this would not work ;-)
Sorry if my suggestion was inappropriate, esp given that ImGuiCaptureImageBuf
already exists.
from imgui_test_engine.
FYI, I started to work on integrating imgui_test_engine into hello_imgui (which is a preliminary, before integrating into Dear ImGui Bundle).
If you are interested, I made a quick demo on how easy it can be to setup a test app here:
https://github.com/pthom/hello_imgui_test_engine_demo
At the moment, the integration of imgui_test_engine is not in the main branch of HelloImGui, but in the with_imgui_test_engine branch.
I'll make sure to add some doc about its license when I release it in the main branch.
The code for integratings the test engine was quite simple to add, and is grouped in this folder.
from imgui_test_engine.
Related Issues (20)
- Is the imgui test engine and test suite framework compatible with Google Test? HOT 2
- GatherItems can't see through childs and tables HOT 2
- Minor issue in "misc_clipper" HOT 1
- How to get context of items that are in a 3D scene to participate in a test? HOT 3
- Provide Windows implementation for function ImFileExist HOT 4
- Compilation error on Windows GCC/MingW because code uses try-except statement HOT 3
- ImGuiTestOpFlags_NoFocusWindow flag ignored in function WindowBringToFront HOT 10
- Branch never executed HOT 12
- How to query value from ref? HOT 2
- ImGuiItemStatusFlags errors when building HOT 2
- Missing 1.89.7 tag HOT 1
- Race condition HOT 7
- Idea: testing language bindings by comparing "screen recordings" of imgui_demo
- Screen capture on macOS with HighDPI fails because of FrameBufferScale!=1 HOT 5
- CaptureScreenshotWindow on docked window leads to a black capture HOT 1
- Conan package HOT 4
- Is it possible to use this Test engine for integration tests? HOT 2
- Proposal: Simple MSVC build script (without MSBuild or Make) HOT 5
- Test suite can't find ImGui Git branch if it's not on HEAD HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui_test_engine.