mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Examples: comments.
This commit is contained in:
		@@ -23,13 +23,21 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplA5_Init(display);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //ImFont* my_font0 = io.Fonts->AddFontDefault();
 | 
			
		||||
    //ImFont* my_font1 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //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_font5 = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
 
 | 
			
		||||
@@ -149,14 +149,22 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplDX11_Init(hwnd, g_pd3dDevice, g_pd3dDeviceContext);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
    ImVec4 clear_col = ImColor(114, 144, 154);
 | 
			
		||||
 
 | 
			
		||||
@@ -73,16 +73,21 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplDX9_Init(hwnd, g_pd3dDevice);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    ShowWindow(hwnd, SW_SHOWDEFAULT);
 | 
			
		||||
    UpdateWindow(hwnd);
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
@@ -91,6 +96,8 @@ int main(int, char**)
 | 
			
		||||
    // Main loop
 | 
			
		||||
    MSG msg;
 | 
			
		||||
    ZeroMemory(&msg, sizeof(msg));
 | 
			
		||||
    ShowWindow(hwnd, SW_SHOWDEFAULT);
 | 
			
		||||
    UpdateWindow(hwnd);
 | 
			
		||||
    while (msg.message != WM_QUIT)
 | 
			
		||||
    {
 | 
			
		||||
        if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
 | 
			
		||||
 
 | 
			
		||||
@@ -29,14 +29,22 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplGlfwGL3_Init(window, true);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
    ImVec4 clear_color = ImColor(114, 144, 154);
 | 
			
		||||
 
 | 
			
		||||
@@ -21,14 +21,22 @@ int main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplGlfw_Init(window, true);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
    ImVec4 clear_color = ImColor(114, 144, 154);
 | 
			
		||||
 
 | 
			
		||||
@@ -25,13 +25,21 @@ int SDL_main(int, char**)
 | 
			
		||||
 | 
			
		||||
    // Setup ImGui binding
 | 
			
		||||
    ImGui_ImplSdl_Init(window);
 | 
			
		||||
 | 
			
		||||
    // Load Fonts
 | 
			
		||||
    // (see extra_fonts/README.txt for more details)
 | 
			
		||||
    //ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
    //ImFont* my_font0 = io.Fonts->AddFontDefault();
 | 
			
		||||
    //ImFont* my_font1 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //ImFont* my_font2 = io.Fonts->AddFontFromFileTTF("../../extra_fonts/Karla-Regular.ttf", 16.0f);
 | 
			
		||||
    //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_font5 = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
    //io.Fonts->AddFontDefault();
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
 | 
			
		||||
 | 
			
		||||
    // Merge glyphs from multiple fonts into one (e.g. combine default font with another with Chinese glyphs, or add icons)
 | 
			
		||||
    //ImWchar icons_ranges[] = { 0xf000, 0xf3ff, 0 };
 | 
			
		||||
    //ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 18.0f);
 | 
			
		||||
    //io.Fonts->AddFontFromFileTTF("../../extra_fonts/fontawesome-webfont.ttf", 18.0f, &icons_config, icons_ranges);
 | 
			
		||||
 | 
			
		||||
    bool show_test_window = true;
 | 
			
		||||
    bool show_another_window = false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user