Other Widget
This commit is contained in:
parent
fffaa8b048
commit
8835d15e7c
@ -150,6 +150,8 @@ bool SystemClass::Frame()
|
|||||||
float speed = m_Application->GetSpeed();
|
float speed = m_Application->GetSpeed();
|
||||||
m_imguiManager->WidgetSpeedSlider(&speed);
|
m_imguiManager->WidgetSpeedSlider(&speed);
|
||||||
m_Application->SetSpeed(speed);
|
m_Application->SetSpeed(speed);
|
||||||
|
m_imguiManager->WidgetButton();
|
||||||
|
m_imguiManager->WidgetFPS();
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ Pos=60,60
|
|||||||
Size=400,400
|
Size=400,400
|
||||||
|
|
||||||
[Window][Khaotic Engine]
|
[Window][Khaotic Engine]
|
||||||
Pos=10,10
|
Pos=31,27
|
||||||
Size=694,354
|
Size=694,367
|
||||||
Collapsed=1
|
|
||||||
|
|
||||||
|
@ -45,4 +45,19 @@ void imguiManager::NewFrame()
|
|||||||
void imguiManager::WidgetSpeedSlider(float* speed)
|
void imguiManager::WidgetSpeedSlider(float* speed)
|
||||||
{
|
{
|
||||||
ImGui::SliderFloat("Speed", speed, 0.0f, 100.0f);
|
ImGui::SliderFloat("Speed", speed, 0.0f, 100.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void imguiManager::WidgetButton()
|
||||||
|
{
|
||||||
|
static int counter = 0;
|
||||||
|
|
||||||
|
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
|
||||||
|
counter++;
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Text("counter = %d", counter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void imguiManager::WidgetFPS()
|
||||||
|
{
|
||||||
|
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io->Framerate, io->Framerate);
|
||||||
}
|
}
|
@ -20,6 +20,8 @@ public:
|
|||||||
|
|
||||||
// Widgets
|
// Widgets
|
||||||
void WidgetSpeedSlider(float* speed);
|
void WidgetSpeedSlider(float* speed);
|
||||||
|
void WidgetButton();
|
||||||
|
void WidgetFPS();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ImGuiIO* io;
|
ImGuiIO* io;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user