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