3 #include "../../debug_ui.h"
24 ImGui::DragFloat(uniform->
GetName().c_str(), &uniform_1f->
x);
29 ImGui::TextColored(ImVec4(1, 0, 0, 1), std::string(
"unsupported uniform type, cannot modify uniform '" + uniform->
GetName() +
"'").c_str());
37 if (ImGui::BeginTabBar(
"shader_editor_tabs"))
39 if (ImGui::BeginTabItem(
"shader information"))
41 std::string shader_id =
"id: " + program->
GetID();
42 std::string shader_program_id =
"gl program id: " + std::to_string(program->
GetGLProgramID());
50 if (ImGui::BeginTabItem(
"shader settings"))
52 if (ImGui::Button(
"update uniforms"))
59 if (ImGui::CollapsingHeader(
"uniforms"))
61 for (
int i = 0; i < program->
GetUniforms()->size(); i++)
63 GenerateUniformControl(program->
GetUniforms()->at(i));
67 if (ImGui::CollapsingHeader(
"vertex attributes"))
84 if (ImGui::Begin(
"Shader Editor", &
show))
90 if (ImGui::ListBoxHeader(
"", ImVec2(ImGui::GetColumnWidth() - 15, -1)))
93 std::map<std::string, BlamGLSLShaderProgram*>::iterator it;
95 for (it = programs->begin(); it != programs->end(); it++)
97 bool is_active_item =
false;
99 if (it->second == active_program)
101 is_active_item =
true;
104 if (ImGui::Selectable(it->second->GetID().c_str(), is_active_item))
106 active_program = it->second;
109 if (ImGui::IsItemHovered())
111 ImGui::BeginTooltip();
112 ImGui::PushTextWrapPos(450.0f);
116 std::string shader_id =
"id: " + it->second->GetID();
117 std::string shader_program_id =
"gl program id: " + std::to_string(it->second->GetGLProgramID());
122 ImGui::PopTextWrapPos();
127 ImGui::ListBoxFooter();
138 GenerateShaderProgramControl(active_program);