Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
Chronos::Editor Namespace Reference

Classes

class  EditorManager
 
class  EditorRenderer
 

Functions

std::string generateCode (Chronos::Manager::Manager *manager)
 
void setImGuiStyle ()
 

Function Documentation

◆ generateCode()

std::string Chronos::Editor::generateCode ( Chronos::Manager::Manager manager)

Definition at line 26 of file editorCodeGenerator.cpp.

27{
28 // generate code for initalizer, textured shape, colored shape, polygons,
29 // textures
30 std::string code = ""
31 "#include \"chronos.hpp\"\n"
32 "Chronos::Manager::Initializer initializer;\n"
33 "initializer.WindowWidth = 800;\n"
34 "initializer.WindowHeight = 600;\n"
35 "initializer.BackgroundColor[0] = 0;\n"
36 "initializer.BackgroundColor[1] = 0;\n"
37 "initializer.BackgroundColor[2] = 0;\n"
38
39 "Chronos::Manager::Manager manager(initializer);\n"
40 "//texture\n"
41 "//textured shapes\n"
42
43 "//colored shapes\n"
44
45 "//polygons\n"
46
47 "settings\n"
48
49 "while (!glfwWindowShouldClose(manager.getWindow())) {\n"
50 "if (glfwGetKey(manager.getWindow(), GLFW_KEY_ESCAPE) "
51 "== GLFW_PRESS) {\n"
52 "glfwSetWindowShouldClose(manager.getWindow(), true);\n"
53 "}\n"
54 "manager.drawFrame();\n"
55 "}\n ";
56 return code;
57}
Here is the caller graph for this function:

◆ setImGuiStyle()

void Chronos::Editor::setImGuiStyle ( )

Definition at line 26 of file editorTheme.cpp.

27{
28 // auto &colors = ImGui::GetStyle().Colors;
29 // colors[ImGuiCol_WindowBg] = ImVec4{0.1f, 0.1f, 0.13f, 1.0f};
30 // colors[ImGuiCol_MenuBarBg] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
31
32 // // Border
33 // colors[ImGuiCol_Border] = ImVec4{0.44f, 0.37f, 0.61f, 0.29f};
34 // colors[ImGuiCol_BorderShadow] = ImVec4{0.0f, 0.0f, 0.0f, 0.24f};
35
36 // // Text
37 // colors[ImGuiCol_Text] = ImVec4{1.0f, 1.0f, 1.0f, 1.0f};
38 // colors[ImGuiCol_TextDisabled] = ImVec4{0.5f, 0.5f, 0.5f, 1.0f};
39
40 // // Headers
41 // colors[ImGuiCol_Header] = ImVec4{0.13f, 0.13f, 0.17, 1.0f};
42 // colors[ImGuiCol_HeaderHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
43 // colors[ImGuiCol_HeaderActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
44
45 // // Buttons
46 // colors[ImGuiCol_Button] = ImVec4{0.13f, 0.13f, 0.17, 1.0f};
47 // colors[ImGuiCol_ButtonHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
48 // colors[ImGuiCol_ButtonActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
49 // colors[ImGuiCol_CheckMark] = ImVec4{0.74f, 0.58f, 0.98f, 1.0f};
50
51 // // Popups
52 // colors[ImGuiCol_PopupBg] = ImVec4{0.1f, 0.1f, 0.13f, 0.92f};
53
54 // // Slider
55 // colors[ImGuiCol_SliderGrab] = ImVec4{0.44f, 0.37f, 0.61f, 0.54f};
56 // colors[ImGuiCol_SliderGrabActive] = ImVec4{0.74f, 0.58f, 0.98f, 0.54f};
57
58 // // Frame BG
59 // colors[ImGuiCol_FrameBg] = ImVec4{0.13f, 0.13, 0.17, 1.0f};
60 // colors[ImGuiCol_FrameBgHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
61 // colors[ImGuiCol_FrameBgActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
62
63 // // Tabs
64 // colors[ImGuiCol_Tab] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
65 // colors[ImGuiCol_TabHovered] = ImVec4{0.24, 0.24f, 0.32f, 1.0f};
66 // colors[ImGuiCol_TabActive] = ImVec4{0.2f, 0.22f, 0.27f, 1.0f};
67 // colors[ImGuiCol_TabUnfocused] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
68 // colors[ImGuiCol_TabUnfocusedActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
69
70 // // Title
71 // colors[ImGuiCol_TitleBg] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
72 // colors[ImGuiCol_TitleBgActive] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
73 // colors[ImGuiCol_TitleBgCollapsed] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
74
75 // // Scrollbar
76 // colors[ImGuiCol_ScrollbarBg] = ImVec4{0.1f, 0.1f, 0.13f, 1.0f};
77 // colors[ImGuiCol_ScrollbarGrab] = ImVec4{0.16f, 0.16f, 0.21f, 1.0f};
78 // colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4{0.19f, 0.2f, 0.25f, 1.0f};
79 // colors[ImGuiCol_ScrollbarGrabActive] = ImVec4{0.24f, 0.24f, 0.32f, 1.0f};
80
81 // // Seperator
82 // colors[ImGuiCol_Separator] = ImVec4{0.44f, 0.37f, 0.61f, 1.0f};
83 // colors[ImGuiCol_SeparatorHovered] = ImVec4{0.74f, 0.58f, 0.98f, 1.0f};
84 // colors[ImGuiCol_SeparatorActive] = ImVec4{0.84f, 0.58f, 1.0f, 1.0f};
85
86 // // Resize Grip
87 // colors[ImGuiCol_ResizeGrip] = ImVec4{0.44f, 0.37f, 0.61f, 0.29f};
88 // colors[ImGuiCol_ResizeGripHovered] = ImVec4{0.74f, 0.58f, 0.98f, 0.29f};
89 // colors[ImGuiCol_ResizeGripActive] = ImVec4{0.84f, 0.58f, 1.0f, 0.29f};
90
91 // // Docking
92 // colors[ImGuiCol_DockingPreview] = ImVec4{0.44f, 0.37f, 0.61f, 1.0f};
93
94 // auto &style = ImGui::GetStyle();
95 // style.TabRounding = 4;
96 // style.ScrollbarRounding = 9;
97 // style.WindowRounding = 7;
98 // style.GrabRounding = 3;
99 // style.FrameRounding = 3;
100 // style.PopupRounding = 4;
101 // style.ChildRounding = 4;
102}
Here is the caller graph for this function: