Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecovlee committed Dec 20, 2018
1 parent b2eec14 commit e083cf5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
5 changes: 3 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ class cni_register final {
std::string name;
cs::var func;
template<typename _fT>
cni_register(const char *str, _fT &&func, bool is_const):name(str), func(cs::make_cni(func, is_const)){
cni_register(const char *str, _fT &&func, bool is_const):name(str), func(cs::make_cni(func, is_const))
{
register_list.push_back(this);
}
};
Expand Down Expand Up @@ -330,7 +331,7 @@ namespace imgui_cs_ext {
void add_font_default(number size)
{
ImFontConfig font_cfg = ImFontConfig();
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, %.0fpx", (float)size);
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, %.0fpx", (float)size);
ImGui::GetIO().FontDefault = ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(imgui_cs::get_droidsans_ttf_data(), size, &font_cfg);
}

Expand Down
2 changes: 1 addition & 1 deletion imgui_gl2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace imgui_cs {
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL2_Init();
ImFontConfig font_cfg = ImFontConfig();
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, 14px");
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, 14px");
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(get_droidsans_ttf_data(), 14, &font_cfg);
}

Expand Down
26 changes: 13 additions & 13 deletions imgui_gl3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ namespace imgui_cs {
if (!glfwInit())
throw cs::lang_error("Init OpenGL Error.");
#if __APPLE__
// GL 3.2
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
// GL 3.2
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#else
// GL 3.0
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
// GL 3.0
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
#endif
}

Expand All @@ -66,11 +66,11 @@ namespace imgui_cs {
void init()
{
#if __APPLE__
// GLSL 150
const char* glsl_version = "#version 150";
// GLSL 150
const char* glsl_version = "#version 150";
#else
// GLSL 130
const char* glsl_version = "#version 130";
// GLSL 130
const char* glsl_version = "#version 130";
#endif
glfwMakeContextCurrent(window);
glfwSwapInterval(1);
Expand All @@ -80,7 +80,7 @@ namespace imgui_cs {
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init(glsl_version);
ImFontConfig font_cfg = ImFontConfig();
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, 14px");
ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "DefaultFont, 14px");
ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(get_droidsans_ttf_data(), 14, &font_cfg);
}

Expand Down
8 changes: 4 additions & 4 deletions src/droidsans_ttf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,8 @@ static const char droidsans_ttf_compressed_data_base85[167935+1] =
"pL;8$IH4I#xh'+$wXM8$QaXI#(+L+$'f`8$`G_J#uBwntj2#&#S@wntW:$##(PUV$$t#p@4####";

namespace imgui_cs {
const char *get_droidsans_ttf_data()
{
return droidsans_ttf_compressed_data_base85;
}
const char *get_droidsans_ttf_data()
{
return droidsans_ttf_compressed_data_base85;
}
}

0 comments on commit e083cf5

Please sign in to comment.