jvcleave / ofxImGui

Use ImGui in openFrameworks
303 stars 125 forks source link

UTF-8 rendering fails with garbled characters. I need your help! Thank you! #101

Closed tutotoo closed 1 year ago

tutotoo commented 4 years ago
ImGuiIO& io = ImGui::GetIO();
string  inputPath = ofFilePath::getAbsolutePath("arialuni.ttf");
io.Fonts->AddFontFromFileTTF(inputPath.c_str(),18.0f, NULL, io.Fonts->GetGlyphRangesChineseFull());

ImGui::Begin(u8"setting收到", nullptr);

Rendering with ofxImGuiLite succeeds but fails with yours. System windows 10 x64 graphics card Radeon pro 555x

other

GLuint BaseEngine::loadTextureImage2D(unsigned char * pixels, int width, int height)

Can only render in RGBA format. Failed to draw using camera image needs to modify RGBA in glTexImage2D to RGB. This is a rendering channel problem.

Daandelange commented 1 year ago

Hello, Sorry for this late answer. Indeed, there's no support for RGB/ARB textures in ImGui, only RGBA. If ofxImGuiLite implements it, we might be able to solve this, I wasn't aware of that implementation. I've implemented a warning message if using the helper functions : 5bfb1f4

Daandelange commented 1 year ago

I'm closing this as a warning message has been implemented about this "impossible use".

Another issue could be opened for bringing support for more texture formats, but that would need some more investigation / background info.