Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[report] compiled all the examples on Windows10 / Visual Studio 2017 #2

Closed
moebiussurfing opened this issue Jan 16, 2021 · 4 comments
Closed

Comments

@moebiussurfing
Copy link
Collaborator

moebiussurfing commented Jan 16, 2021

hey @Daandelange,
awesome work! thanks.

I just tested/compiled ALL the amazing bundled examples on Windows10 / Visual Studio 2017.
I used the Project Generator like usual, x64 and release.

I report here the problems I have seen on the examples with errors or unexpected behavior:
The non mentioned examples are working fine.

(I do not try to solve anything yet, or reading/understanding all the ofApp comments, just compiled for now.)

Main bug in all examples:
The layout is not reloaded when reopening the app. It seems that it's stored fine on imgui.ini file on exit the app.

example-advanced
do not compiles. Errors:

2>imdrawlist_party.cpp
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2061: syntax error: identifier 'ImVec2'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'IM_PI': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'A': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ')' before identifier 'S'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2143: syntax error: missing ';' before '{'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2447: '{': missing function header (old-style formal list?)
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'ImClamp': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2275: 'B': illegal use of this type as an expression
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: see declaration of 'B'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2059: syntax error: '}'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'ImDrawList': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'F': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ')' before identifier 'D'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2059: syntax error: 'if'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2059: syntax error: 'for'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2143: syntax error: missing ')' before ';'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2143: syntax error: missing ';' before '<'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2059: syntax error: '++'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2059: syntax error: ')'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2131: expression did not evaluate to a constant
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: failure was caused by non-constant arguments or reference to a non-constant symbol
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: see usage of 'M'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2369: 'Q': redefinition; different subscripts
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: see declaration of 'Q'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'X': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'T': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3861: 'fmodf': identifier not found
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'e': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3927: '->': trailing return type is not allowed after a non-function declarator
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3613: missing return type after '->' ('int' assumed)
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ';' before identifier 'AddRectFilled'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2143: syntax error: missing ';' before '+='
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ';' before identifier 'S'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'S': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3861: 'ImFloor': identifier not found
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2064: term does not evaluate to a function taking 2 arguments
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3861: 'R': identifier not found
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3861: 'I': identifier not found
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2143: syntax error: missing ';' before '-='
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2040: 'N': 'int' differs in levels of indirection from 'B &'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2086: 'int A': redefinition
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: see declaration of 'A'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ';' before identifier 'P'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'P': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2065: 'b': undeclared identifier
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C3861: 'ImClamp': identifier not found
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2086: 'int F': redefinition
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): note: see declaration of 'F'
2>f:\openframeworks\addons\ofximgui\example-advanced\src\fx.cpp(3): error C2146: syntax error: missing ';' before identifier 'AddCircleFilled'

example-dockingandviewports
it works.
BUT: dock zone overlays sometimes disappear.
dragging out of the app window works fine.

example-multiwindow
Bug verified when the two windows differ size. Working better when sizes similar as expected.
10% of the time crashes when closing one window. It seems no matter which window is closed first...

@Daandelange
Copy link
Owner

Daandelange commented Jan 16, 2021

Hey, thanks for testing. :)

In example-advanced, fx.cpp file is a highly compressed (<1kb) source code, but there's too much errors for the compression to be the source of the problem.
In the original drawlist_party code, it was a .inl file. I think the VS project compiles it alone, as a .cpp file. Can you try with the commit above ?

example-dockingandviewports : Indeed, I'm having the same issue now on osx too. If at least 1 window is docked, it works, otherwise, not... No idea what the issue is.
Edit: And it only happens when ImGuiConfigFlags_DockingEnable is set. Also, it looks something doesn't restore correctly for the oF context, the highlighted zone is not drawn behind the text with ofDrawBitmapStringHighlight().

Edit2: About imgui.ini, that's normal behaviour as the new default option is _restoreGuiState=false. This could be reversed to true for better backwards compatibility. I made it false because I consider it to be an advanced feature, that was on by default in the previous implementation (and in imgui).

Related to #1

Daandelange added a commit that referenced this issue Jan 16, 2021
…ffseted background with highlighted bitmap strings (mentioned in #2)
Daandelange added a commit that referenced this issue Jan 16, 2021
…parent docking space renders a background...

Should fix example-dockingandviewports in #2
Also improves stability of the example.
@moebiussurfing
Copy link
Collaborator Author

moebiussurfing commented Jan 16, 2021

example-advanced: fixed with the new commit. working.

imgui.ini layout auto recall on startup works as you said.
( gui.setup(nullptr, true, false, true, true);)
cool! now I switch to this fork. thanks again.

I'll report as soon as I check more than one instance at the same time.
Tell me if you want to check another thing.

@Daandelange
Copy link
Owner

Yay, thanks !
gui.setup(nullptr, true, ImGuiConfigFlags_None, true, true); would be more appropriate for .ini setting.
Also keep in mind that the rpi implementation (GL ES) and Vulkan are probably broken, if you need to support these.

Does example-multiwindows still crash sometimes ?
What about docking and viewports ?

I'm also hesitating to change the autoDraw parameter to always draw after ofApp.draw() (instead of the original way @ gui.end()). That would bring more clarity in the oxImGui API : gui.start(); /* exclusively GUI composition code ... */ gui.end(); and an optional gui.render(); if one wishes to manually control the rendering order. And it would not break the original API that much. What do you think ?

@moebiussurfing
Copy link
Collaborator Author

moebiussurfing commented Jan 17, 2021

Does example-multiwindows still crash sometimes ?

Not much, it's working fine now. (Not sure why crashed yesterday).

What about docking and viewports ?

It works very well.
When trying to enable the restore-layout ini settings I made this:
gui.setup(nullptr, false, ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_ViewportsEnable, true, true);
But to allow working well I had to change the flag:
ImGuiCond_Once -> ImGuiCond_FirstUseEver
That's the expected behavior. So its working perfect. The out-of-OF-app window panels are reopening correctly as well.

void drawWindow(const char* _title, int _x=300, int _y=300, ImGuiWindowFlags _flags=ImGuiWindowFlags_None ){
    ImGui::SetNextWindowSize(ImVec2(200,200), ImGuiCond_FirstUseEver);
    ImGui::SetNextWindowPos(ImVec2(_x+ofGetWindowPositionX(),_y+ofGetWindowPositionY()), ImGuiCond_FirstUseEver);

hesitating to change the autoDraw parameter to always draw after ofApp.draw()

I agree, should be always in front...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants