Comments (10)
Hey,
Supposing your code runs fine on other platforms, I'd start checking here if the mouse state is set correctly. If not, that could help you tell if the issue is oF related or ofxImGui related. The BaseEngine
(or child) class should set the mousePressed
state every frame.
(I've no experience with either rt-boards or egl windows.)
from ofximgui.
Thank you!!
Coords look correct but im not sure about index, i mean if i click mouse left click do you know wich index is correct¿ for me mouse lef is index 1 and right is index 3.
engine.mousePressed[i] returns 1 when click
for (int i = 0; i < 5; i++) {
io.MouseDown[i] = engine.mousePressed[i];
}
from ofximgui.
The (default) BaseEngine
behaviour is here but it can be overridden by the childEngine.
It looks like the ofEvent buttons are window-implementation-dependent : GLFW uses for example this code where the oF button number is mapped to the GLFW ones. So maybe you need to check the EGL specs ?
ofxImGui tries to guess the needed engine, but the else
case chooses EngineGLFW
, so you're probably using that one` on an EGL window. (because EGL is [I think] unimplemented in ofxImGui)
from ofximgui.
I understand what you say, but rendering is opengles, i had a typo on first post (i had opengl) so EngineOpenGLES (i checked), in fact i see rollover on widgets so we can assume that mouse coords are passing to imgui.
EDIT: I chechek and mouseDown go to https://github.com/ocornut/imgui/blob/04fd5072fbc635cc7a8814b8543d40836248d3a7/imgui.cpp#L3642
Sure is a dumb detail.... but i can not find where the problem is.
- coords works because i see rollover
- mouseDown propagate
What im missing? is there something like check if click inside widget or like in any point is translating mouseDown to other event that is used to set click to widget...
Thank you
from ofximgui.
Hard to say, could be anything. Beware, your link points to another imgui version than the one in ofxImGui.
Maybe try to show the imgui metrics window and check for anomalies ? (you can see imgui's inner state there)
from ofximgui.
i just found the problem
index for buttons do not match and also mask do not match,i can fix index but i dont understand how mask works
ofxImGui/libs/imgui/src/imgui_internal.h
Line 452 in 330e142
i understand is related to those
https://github.com/openframeworks/openFrameworks/blob/7c46c8a9415703c1cf7ce1bb66c91cc97851fa19/libs/openFrameworks/app/ofAppEGLWindow.cpp#L85
Can you point me where to learn how those mas works? so i can find the correct relation.
I know those two are the problems as i made a quick hack and now i get click on buttons and sliders
Thank you
from ofximgui.
Sounds complicated to me, not sure you're looking at the right place...
The mouse state goes from EGL -> ofAppEGLWindow [oF] -> Engine[ofxImGui] -> DearImGui
. IMO, that ImGuiButtonFlags_
have nothing to do with your issue, here's more info if you wanna learn them.
If the indexes are wrong, I'd try something like this but within EngineOpenGLES::mousePressed
(which you need to create, and rebind).
from ofximgui.
Yep i have it working in a not much elegant way, but hey it works :)
I think masking are related because here are used to set the state of pressed
https://github.com/ocornut/imgui/blob/04fd5072fbc635cc7a8814b8543d40836248d3a7/imgui_widgets.cpp#L553
Problem was incorrect indexes and that masking do not match, when i have time will do a EngineEGL
Funny thing is that this give me a clue to make Fbo works on egl/rockchip as i can draw an fbo to the guy but not directly on screen so i know that error must be on drawing part
Thank you so much for your help!!!
// Poll buttons
int mouse_button_clicked = -1;
int mouse_button_released = -1;
if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseClicked[0]) { mouse_button_clicked = 0; }
else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseClicked[1]) { mouse_button_clicked = 1; }
else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && g.IO.MouseClicked[2]) { mouse_button_clicked = 2; }
if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseReleased[0]) { mouse_button_released = 0; }
else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseReleased[1]) { mouse_button_released = 1; }
from ofximgui.
ok, great. Don't hesitate to make an EngineEGL or simply share some more code when you find new fixes.
As for your Fbo issue, sounds like a GL context restore issue; to diagnostic, try your fbo stuff without loading/using ofxImGui : if the FBO works it might be related to that.
from ofximgui.
i need to test again the gui because i found how to make glfw work using egl so i suppose that then no need to create a "engine wrapper" will test soon.
Will take a look at what you say for fbo, for now i discovered that if i attach the fbo texture to a plane it renders ok but i need to flip it with a shader..... im close to have all working
will post on forum when everything works for people reference
from ofximgui.
Related Issues (20)
- No gui on Android HOT 2
- UTF-8 rendering fails with garbled characters. I need your help! Thank you! HOT 2
- input latin characters HOT 2
- ofxImGuiLoggerChannel.h HOT 2
- Merging forks : ImGuiContext and more HOT 8
- ofxImGui upgrade HOT 8
- arb textures HOT 1
- imgui_stdlib.h and imgui_stdlib.cpp should be included in project files HOT 1
- Closing a window within a window? HOT 3
- imgui_impl_glfw_context_support.h missing from develop branch.
- develop brach broken HOT 5
- ofxImGui::Gui::exit() released context, can't Gui::setup() again HOT 2
- OF 0.12 compatibility HOT 1
- Drawing ofFbo's texture as ImGui::Image(); HOT 3
- constexpr float ofColorScale: Syntax error in input HOT 1
- Example Demo will not compile Ubuntu version 24.04 and Openframeworks version 0.12.0 both fresh install HOT 2
- it's possible to use more than one instance of ofxImGui (inside classes) in the same ofApp? HOT 3
- Unknown type name 'ofVec2f'
- I make oF window borderless(not fullscreen),the screen display has an offset(mouse also)
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 ofximgui.