|
|
@ -13,31 +13,32 @@ static void error_callback(int error, const char* description) |
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) |
|
|
|
int main(int argc, char** argv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Setup window
|
|
|
|
glfwSetErrorCallback(error_callback); |
|
|
|
glfwSetErrorCallback(error_callback); |
|
|
|
if (!glfwInit()) |
|
|
|
if (!glfwInit()) |
|
|
|
exit(1); |
|
|
|
exit(1); |
|
|
|
|
|
|
|
|
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); |
|
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); |
|
|
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); |
|
|
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); |
|
|
|
|
|
|
|
|
|
|
|
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL); |
|
|
|
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL); |
|
|
|
glfwMakeContextCurrent(window); |
|
|
|
glfwMakeContextCurrent(window); |
|
|
|
gl3wInit(); |
|
|
|
gl3wInit(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Setup ImGui binding
|
|
|
|
|
|
|
|
ImGui_ImplGlfwGL3_Init(window, true); |
|
|
|
//ImGuiIO& io = ImGui::GetIO();
|
|
|
|
//ImGuiIO& io = ImGui::GetIO();
|
|
|
|
//ImFont* my_font1 = io.Fonts->AddFontDefault();
|
|
|
|
//ImFont* my_font1 = io.Fonts->AddFontDefault();
|
|
|
|
//ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("extra_fonts/Karla-Regular.ttf", 15.0f);
|
|
|
|
//ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("extra_fonts/Karla-Regular.ttf", 15.0f);
|
|
|
|
//ImFont* my_font3 = io.Fonts->AddFontFromFileTTF("extra_fonts/ProggyClean.ttf", 13.0f); my_font3->DisplayOffset.y += 1;
|
|
|
|
//ImFont* my_font3 = io.Fonts->AddFontFromFileTTF("extra_fonts/ProggyClean.ttf", 13.0f); my_font3->DisplayOffset.y += 1;
|
|
|
|
//ImFont* my_font4 = io.Fonts->AddFontFromFileTTF("extra_fonts/ProggyTiny.ttf", 10.0f); my_font4->DisplayOffset.y += 1;
|
|
|
|
//ImFont* my_font4 = io.Fonts->AddFontFromFileTTF("extra_fonts/ProggyTiny.ttf", 10.0f); my_font4->DisplayOffset.y += 1;
|
|
|
|
//ImFont* my_font5 = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, io.Fonts->GetGlyphRangesJapanese());
|
|
|
|
//ImFont* my_font5 = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, io.Fonts->GetGlyphRangesJapanese());
|
|
|
|
ImGui_ImplGlfwGL3_Init(window, true); |
|
|
|
ImGui_ImplGlfwGL3_InitFontsTexture(); |
|
|
|
ImGui_ImplGlfwGL3_LoadFontsTexture(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool show_test_window = true; |
|
|
|
bool show_test_window = true; |
|
|
|
bool show_another_window = false; |
|
|
|
bool show_another_window = false; |
|
|
|
ImVec4 clear_color = ImColor(114, 144, 154); |
|
|
|
ImVec4 clear_color = ImColor(114, 144, 154); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main loop
|
|
|
|
while (!glfwWindowShouldClose(window)) |
|
|
|
while (!glfwWindowShouldClose(window)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|