simongeilfus / cinder-imgui Goto Github PK
View Code? Open in Web Editor NEWDear ImGui Renderer/Wrapper for Cinder
Dear ImGui Renderer/Wrapper for Cinder
I think you may have forgotten to commit the new ref with a0f5645 ;)
I use cinder-imgui in ubuntu 14 to write some toy code. When i pressed keyboard to type characters to ui::InputText widgets, the widgets' contents didn't insert any new characters. However, when i pressed the delete key, the characters in widgets could be deleted. Even in the test demo window, i can't insert any words in console examples. The 'WantCaptureKeyboard' and 'WantTextInput' flags in test demo windows were set to 1 when i focus and ui::InputText. It works when i test samples in imgui, but it dosen't works when i test in cinder-imgui. Could any one can give some advice how to set cinder-imgui properly?
Hey, any chance you could add the following attribute to your cinderblock.xml file so that Tinderbox can add it to projects as a submodule?
git="[email protected]:simongeilfus/Cinder-ImGui.git"
There is a recent change that moves ButtonRepeat to a new location. The Cinder-ImGui code will need to be modified to reflect this change.
Could you please set an opensource license for your work? So I can use it without worries.
TIA :)
Hi, I occasionally get this crash:
Assertion failed: (g.IO.DeltaTime >= 0.0f), function NewFrame, file /Applications/_cinder/CinderApps/ross_smith/ornicube/Ornicube/blocks/ImGui/lib/imgui/imgui.cpp, line 2089.
Which was reported to Imgui here and resolved here
any chance of updating the Imgui submodule to include this fix?
Hi,
I believe I have found an issue with font rendering on MacOS. The same code works fine on Windows 10. The issue is that symbols are rendered as questions marks when a font is loaded from a file path. Here is a screenshot of the problem:
As you can see, the period (.) character is rendered as a question mark. I tested other common ascii symbols, some of them work and some of them don't.
My setup:
libcinder on master (a6dc85ba1)
MacOS 10.14.4
MacBook Pro 2012, NVIDIA GeForce 660m/Intel HD 4000
Steps to reproduce:
auto config = ui::Options().font(getAssetPath("ProggyClean.ttf"), 12);
ui::initialize(config);
//ui::initialize();
Curious if there's recommendations for the best way to get retina support working. Reading through the ImGui issue queue it sounds like they suggest just doubling the font sizes. You can't specify a size for the default font so it seems like you need to manually load a font (that's what prompted #40 asking about loading fonts by name).
This seems to work reasonably but I'd love to stick with the default font:
ui::initialize( ui::Options().font( "/Library/Fonts/Arial.ttf", 13.0 * getWindow()->getContentScale() ) );
I opened up ocornut/imgui#1076 to see about getting a parameter added to specify a font size for the default font.
The line 925
static signals::ConnectionList sWindowConnections;
throws a compiler error:
/Users/rodrigo/Herramientas/cinder_0.9.0_mac/blocks/Cinder-ImGui/src/CinderImGui.cpp:925:17: No type named 'ConnectionList' in namespace 'cinder::signals'; did you mean 'Connection'?
Cinder is moving away from boost, so you may want update using #include "cinder/Noncopyable.h" instead. :)
In my project i use Cinder-ImGui.
If run it on xcode 5.1.1 it works fine, but after migrating to xcode 7.2.1 got runtime error on audio init:
Same result if just adding line
auto audioContext = cinder::audio::Context::master();
into function setup() of BasicApp.cpp (sample file of Cinder-ImGui).
Cinder rebuilding is done.
Something like this was described here
https://forum.libcinder.org/topic/imgui#23286000002731003
but no solution is recommended.
Any suggestions?
Thank you in advance
Hi Simon,
I've pulled the latest imgui subrepo and it doesn't compile anymore, I think the ImGui syntax for SetClipboardTextFn and GetClipboardTextFn have changed adding an extra "void* user_data" argument.
I've updated the Cinder-ImGui code and it does compile, but I'm not sure how the clipboard works so I didn't submit a pull request or tested anything, you might want to double check it.
CinderImGui.cpp #1004
#ifndef CINDER_LINUX
// clipboard callbacks
io.SetClipboardTextFn = []( void* user_data, const char* text ){
const char* text_end = text + strlen(text);
char* buf = (char*)malloc(text_end - text + 1);
memcpy(buf, text, text_end-text);
buf[text_end-text] = '\0';
Clipboard::setString( buf );
free(buf);
};
io.GetClipboardTextFn = []( void* user_data ){
string str = Clipboard::getString();
static vector<char> strCopy;
strCopy = vector<char>(str.begin(), str.end());
strCopy.push_back('\0');
return (const char *) &strCopy[0];
};
#endif```
What causes sliders (ui::SliderFloat
) to switch over to text-input mode? Sometimes the gui switches modes and I can no longer slide the sliders until I restart the application (attempting to slide creates a text input buffer). Any idea what might be causing this?
May be a how-to-use question more than a bug, but it's unclear what causes the switch.
Trying to set the font scale in the initialisation options causes an error.
ui::initialize( ui::Options().fontGlobalScale( getWindowContentScale() ) );
results in:
Assertion failed: (GImGui != __null && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?"), function GetIO, file /Users/felixfaire/Developer/Cinder-0.9/Cinder/blocks/Cinder-ImGui/lib/imgui/imgui.cpp, line 2638.
in GetIO()
Most other options seem to be ok.
Macbook pro, macos Mojave.
Hi,
I'm trying to load a custom or the default imgui font, add FontAwesome(with merge) and the relative icons range so I can use the font's header definitions ie. #define ICON_FA_GLASS u8"\uf000"
I'm not sure I understand how to do it using the Options during initialisation. I tried to use the native imgui method, but I guess it conflicts with the cinder implementation.
I am currently using MacOS Sierra. I can get other libs like PretzelGUI working and so on, but ImGUI is not able to be generated by tinderbox -> this is the error I get:
Unable to copy from /Users/luisarandas/cinder_0.9.1_mac/blocks/Cinder-ImGui/lib/imgui/imconfig.h to /Users/luisarandas/cinder_0.9.1_mac/myApps/test/blocks/ImGui/lib/imgui/imconfig.h(GenerateFailed)
The lib folder seems to be empty.
Thanks in advance
Hi,
I think there is a mistake on the project. It doesn't include any file inside lib/imgui folder; then Xcode doesn't find "imgui.h" and the rest.
How can I try this block?
Thanks
David
As stated in the title...can be a bit limiting, particularly for the multi-line editor. If you have a clipboard with more than 128 characters in it, you can't paste into the multiline editor. If you try to type more than 128 characters in one go, you can't -- you have to click away from the editor and then reactivate it.
I'd suggest just using a bigger "padding" on each edit (it's always relative to the current size).
When creating the xcode project with Tinderbox, imgui_widgets.cpp are not included a thus the project is not compiling.
Adding the file solves the problem.
Not sure if this error is better addresses on Cinder repo Linux branch as don't understand what is going on but despite Clipboard.h being present and functions existing I get:
CMakeFiles/Cicada.dir/home/renechristen/Applications/_cinder/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp.o: In function
operator()':
/home/renechristen/Applications/_cinder/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:932: undefined reference to cinder::Clipboard::getString()' /home/renechristen/Applications/_cinder/Cinder.git/blocks/Cinder-ImGui/src/CinderImGui.cpp:928: undefined reference to
cinder::Clipboard::setString(std::string const&)'
`
If you try to specify multiple glyph ranges, you only get the first one.
For example:
// In setup():
auto robo = getAssetPath("Roboto-Medium.ttf");
auto const firstArrow = L'←';
auto const lastArrow = L'↓';
auto options = ui::Options()
.fonts({ { robo, 16.0f } }, false)
.fontGlyphRanges(robo.stem().string(), { 0x20, 0xff, firstArrow, lastArrow, 0 });
// ... more setup of options ...
ui::initialize(options);
Then, later in the GUI drawing code, try to draw using a mixture of characters from both glyph ranges (here, the arrows will show the "missing" symbol). For example:
if (ui::MenuItem(u8"Move up (shift-↑)")) {
// blah
}
...so it doesn't work with Tinderbox:
https://github.com/simongeilfus/Cinder-ImGui/tree/master/lib
As per the title -- if you do Cmd-C and then Cmd-V to paste, nothing happens in (for example) an InputTextMultiline editor. The is_shortcut_key_only
flag is not triggered in imgui by the Cinder block, because it expects to be using io.KeySuper
on macOS, and that's never set.
when I resize my Cinder app, it quits
i ran into these problems when trying to run with xcode
ImGuiWindow* GetCurrentWindow()
I noticed that rendering may be broken on macOS Mojave. ImGui is being drawn at the wrong scale and mouse clicks don't align with what is drawn. I've also noticed clipping some problems.
To reproduce, start an empty project with TinderBox + the Cinder-ImGui block and add the hello-world example,
void cinderApp::setup() {
ImGui::initialize();
}
void cinderApp::draw() {
gl::clear( Color( 0, 0, 0 ) );
ImGui::Text("Hello, world!");
}
Tested using the latest Cinder 0.9.2dev, although the problem exists with previous versions. I get
I also get the same just by rebuilding some of my previous projects, which is how i noticed this in the first place - the problem there is even more pronounced and makes ImGui essentially unusable. My hunch is that it's related to Mojave, although i've only returned to Cinder since upgrading so i can't be sure when this first occurred. Any thoughts?
S should be lowercase. Fine on OSX and Windows but throws error on Linux branch
Hello
I cannot build this block the following errors.
When I comment out these code, it works fine.
How to fix this errors?
I'm using
It looks like they were removed in 02a331d but not removed from cinderblock.xml
.
It seems like it requires a path even though ci::Font
can load by name. Am I missing something?
Hi,
loading a custom font crash on windows, I tried both Roboto and FontAwesome, so I assume the fonts are fine, the same code works just fine on mac.
std::vector<ImWchar> iconsRange = { ICON_MIN_FA, ICON_MAX_FA, 0 };
std::vector<ImWchar> textRange = { 0x0001, 0x00BF, 0 };
std::vector<std::pair<fs::path,float>> fontPaths;
fontPaths.push_back( make_pair<fs::path,float>( getAssetPath("fonts/Roboto/Roboto-Regular.ttf"), 13.0f ) );
fontPaths.push_back( make_pair<fs::path,float>( getAssetPath("fonts/fontawesome-webfont.ttf"), 12.0f ) );
ui::initialize( ui::Options().fonts( fontPaths, true )
.fontGlyphRanges( "fontawesome-webfont", iconsRange )
.fontGlyphRanges( "Roboto-Regular", textRange ) );
The code breaks in ImFontAtlas::Build()
any idea?
Hi, this is not actually an issue.
I am new to Cinder and OpenGL.
I'm getting stuck on creating ImGUI Windows on Multi Cinder's Window.
Everything is fine if application have some ImGUI windows on single Cinder's window.
But when it open the second Cinder's window, it crashes and generates bellow errors:
|warning| cinder::gl::VaoImplCore::bindImpl[77] VAO bound against different context from allocation. Reassigning context.
Assertion failed!
Program: ...or\jellyfish\build\GoCrypto\Debug\cinder_imgui.dll
File: e:\projects\externals\cinder\blocks\cinder-...\imgui.cpp
Line: 4432
Expression: g.FrameCountEnded != g.FrameCount'
Does sound like ImGUI does not support dispplay multi windows on Multi Cinder's windows?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.