2015-06-15 18:23:57 +02:00
//
// debug_hud.cpp
// imguiex
# include <stdio.h>
# include "debug_hud.h"
# include "imgui.h"
void DebugHUD_InitDefaults ( DebugHUD * hud )
{
2017-12-24 18:16:22 +01:00
hud - > show_demo_window = true ;
2015-07-08 05:35:09 +02:00
hud - > show_example_window = true ;
hud - > rotation_speed = 15.0f ;
2015-06-15 18:23:57 +02:00
2015-07-08 05:35:09 +02:00
hud - > cubeColor1 [ 0 ] = 0.4f ;
hud - > cubeColor1 [ 1 ] = 0.4f ;
hud - > cubeColor1 [ 2 ] = 1.0f ;
hud - > cubeColor1 [ 3 ] = 1.0f ;
2015-06-15 18:23:57 +02:00
2015-07-08 05:35:09 +02:00
hud - > cubeColor2 [ 0 ] = 1.0f ;
hud - > cubeColor2 [ 1 ] = 0.4f ;
hud - > cubeColor2 [ 2 ] = 0.4f ;
hud - > cubeColor2 [ 3 ] = 1.0f ;
2015-06-15 18:23:57 +02:00
}
2017-08-11 07:36:28 +02:00
void DebugHUD_DoInterface ( DebugHUD * hud )
2015-06-15 18:23:57 +02:00
{
2017-12-24 18:16:22 +01:00
if ( hud - > show_demo_window )
2015-06-15 18:23:57 +02:00
{
2017-12-24 18:45:11 +01:00
ImGui : : SetNextWindowPos ( ImVec2 ( 650 , 20 ) , ImGuiCond_FirstUseEver ) ; // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
2017-12-24 18:16:22 +01:00
ImGui : : ShowDemoWindow ( & hud - > show_demo_window ) ;
2015-06-15 18:23:57 +02:00
}
if ( hud - > show_example_window )
{
2015-07-08 05:35:09 +02:00
ImGui : : Begin ( " Another Window " , & hud - > show_example_window ) ;
2017-09-01 17:06:26 +02:00
ImGui : : Text ( " Hello from another window! " ) ;
2015-06-15 18:23:57 +02:00
ImGui : : ColorEdit3 ( " Cube 1 Color " , hud - > cubeColor1 ) ;
ImGui : : ColorEdit3 ( " Cube 2 Color " , hud - > cubeColor2 ) ;
2015-07-08 05:35:09 +02:00
ImGui : : SliderFloat ( " Rotation Speed " , & hud - > rotation_speed , 0.0f , 200.0f ) ;
2015-06-15 18:23:57 +02:00
ImGui : : End ( ) ;
}
2015-07-08 05:35:09 +02:00
}