You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/gui/imgui_ext.h

33 lines
1.2 KiB
C

/******************************************************************************
* File - imgui_ext.h
* Author - Joey Pollack
* Date - 2022/07/07 (y/m/d)
* Mod Date - 2022/07/07 (y/m/d)
* Description - Adds new and custom methods to the imgui api
******************************************************************************/
#ifndef LUNARIUM_IMGUI_EXT_H_
#define LUNARIUM_IMGUI_EXT_H_
#include <core/common_defs.h>
#include <glm/glm.hpp>
#include <string>
namespace lunarium
{
class ImGuiExt
{
public:
/// This function was taken from the Hazel engine written by Cherno!
/// https://github.com/TheCherno/Hazel/blob/master/Hazelnut/src/Panels/SceneHierarchyPanel.cpp
static bool Vec3Control(const std::string& label, glm::vec3& values, float resetValue = 0.0f, float columnWidth = 100.0f);
static bool Vec2Control(const std::string& label, glm::vec3& values, float resetValue = 0.0f, float columnWidth = 100.0f);
static bool FloatControl(const std::string& label, float& values, float resetValue = 0.0f, float columnWidth = 100.0f);
static void TextCentered(const std::string text);
static bool ButtonCentered(const char* label, float alignment = 0.5f);
};
}
#endif // LUNARIUM_IMGUI_EXT_H_