diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 62752d7a..43a90bb7 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -773,7 +773,7 @@ struct Imgui void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int32_t _scroll, uint16_t _width, uint16_t _height, char _inputChar, uint8_t _view) { - IMGUI_beginFrame(_mx, _my, _button, _width, _height, _view); + IMGUI_beginFrame(_mx, _my, _button, _width, _height, _inputChar, _view); m_view = _view; m_viewWidth = _width; diff --git a/examples/common/imgui/ocornut_imgui.cpp b/examples/common/imgui/ocornut_imgui.cpp index 6219d4cf..94499db2 100644 --- a/examples/common/imgui/ocornut_imgui.cpp +++ b/examples/common/imgui/ocornut_imgui.cpp @@ -140,7 +140,7 @@ struct OcornutImguiContext const bgfx::Memory* mem = bgfx::alloc((uint32_t)(tex_y * pitch)); memcpy(mem->data, tex_data, size_t(pitch * tex_y)); - m_texture = bgfx::createTexture2D((uint16_t)tex_x + m_texture = bgfx::createTexture2D( (uint16_t)tex_x , (uint16_t)tex_y , 1 , bgfx::TextureFormat::BGRA8 @@ -160,10 +160,11 @@ struct OcornutImguiContext bgfx::destroyProgram(m_program); } - void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, uint8_t _viewId) + void beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId) { m_viewId = _viewId; ImGuiIO& io = ImGui::GetIO(); + io.AddInputCharacter(_inputChar & 0x7f); // ASCII or GTFO! :) io.DisplaySize = ImVec2((float)_width, (float)_height); io.DeltaTime = 1.0f / 60.0f; io.MousePos = ImVec2((float)_mx, (float)_my); @@ -201,9 +202,9 @@ void IMGUI_destroy() s_ctx.destroy(); } -void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, uint8_t _viewId) +void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId) { - s_ctx.beginFrame(_mx, _my, _button, _width, _height, _viewId); + s_ctx.beginFrame(_mx, _my, _button, _width, _height, _inputChar, _viewId); } void IMGUI_endFrame() diff --git a/examples/common/imgui/ocornut_imgui.h b/examples/common/imgui/ocornut_imgui.h index 93cf9066..125a7fb4 100644 --- a/examples/common/imgui/ocornut_imgui.h +++ b/examples/common/imgui/ocornut_imgui.h @@ -10,7 +10,7 @@ void IMGUI_create(); void IMGUI_destroy(); -void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, uint8_t _viewId = 31); +void IMGUI_beginFrame(int32_t _mx, int32_t _my, uint8_t _button, int _width, int _height, char _inputChar, uint8_t _viewId); void IMGUI_endFrame(); #endif // OCORNUT_IMGUI_H_HEADER_GUARD