Cleanup.
This commit is contained in:
parent
501d260c3f
commit
d5bea0e7fd
@ -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)
|
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_view = _view;
|
||||||
m_viewWidth = _width;
|
m_viewWidth = _width;
|
||||||
|
@ -140,7 +140,7 @@ struct OcornutImguiContext
|
|||||||
const bgfx::Memory* mem = bgfx::alloc((uint32_t)(tex_y * pitch));
|
const bgfx::Memory* mem = bgfx::alloc((uint32_t)(tex_y * pitch));
|
||||||
memcpy(mem->data, tex_data, size_t(pitch * tex_y));
|
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
|
, (uint16_t)tex_y
|
||||||
, 1
|
, 1
|
||||||
, bgfx::TextureFormat::BGRA8
|
, bgfx::TextureFormat::BGRA8
|
||||||
@ -160,10 +160,11 @@ struct OcornutImguiContext
|
|||||||
bgfx::destroyProgram(m_program);
|
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;
|
m_viewId = _viewId;
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
io.AddInputCharacter(_inputChar & 0x7f); // ASCII or GTFO! :)
|
||||||
io.DisplaySize = ImVec2((float)_width, (float)_height);
|
io.DisplaySize = ImVec2((float)_width, (float)_height);
|
||||||
io.DeltaTime = 1.0f / 60.0f;
|
io.DeltaTime = 1.0f / 60.0f;
|
||||||
io.MousePos = ImVec2((float)_mx, (float)_my);
|
io.MousePos = ImVec2((float)_mx, (float)_my);
|
||||||
@ -201,9 +202,9 @@ void IMGUI_destroy()
|
|||||||
s_ctx.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()
|
void IMGUI_endFrame()
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
void IMGUI_create();
|
void IMGUI_create();
|
||||||
void IMGUI_destroy();
|
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();
|
void IMGUI_endFrame();
|
||||||
|
|
||||||
#endif // OCORNUT_IMGUI_H_HEADER_GUARD
|
#endif // OCORNUT_IMGUI_H_HEADER_GUARD
|
||||||
|
Loading…
Reference in New Issue
Block a user