{"id":21155918,"url":"https://github.com/dfranx/imfiledialog","last_synced_at":"2025-04-09T05:09:29.998Z","repository":{"id":41520298,"uuid":"328761639","full_name":"dfranx/ImFileDialog","owner":"dfranx","description":"A file dialog library for Dear ImGui","archived":false,"fork":false,"pushed_at":"2024-09-16T12:02:53.000Z","size":31,"stargazers_count":538,"open_issues_count":24,"forks_count":64,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-02T04:02:23.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfranx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T18:51:49.000Z","updated_at":"2025-03-31T17:27:53.000Z","dependencies_parsed_at":"2022-09-21T11:51:24.943Z","dependency_job_id":"62357a22-ab01-455d-ac29-736169e4a430","html_url":"https://github.com/dfranx/ImFileDialog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FImFileDialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FImFileDialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FImFileDialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfranx%2FImFileDialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfranx","download_url":"https://codeload.github.com/dfranx/ImFileDialog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T11:32:39.790Z","updated_at":"2025-04-09T05:09:29.969Z","avatar_url":"https://github.com/dfranx.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImFileDialog\nA simple file dialog library for Dear ImGui.\n\nThis library supports favorites, actual Windows icons, image previews, zooming in, etc...\n\n**DISCLAIMER**: This library was designed and built for use in [SHADERed](https://github.com/dfranx/SHADERed) - it uses older version of Dear ImGui so some changes might be required to get it compiled. The way the file filter  and the library itself looks was also limited due to me not wanting to break [SHADERed](https://github.com/dfranx/SHADERed)'s plugins.\n\n## Requirements\nThis library uses C++17's `std::filesystem` but it also needs these libraries:\n * [Dear ImGui](https://github.com/ocornut/imgui/)\n * [stb_image.h](https://github.com/nothings/stb/blob/master/stb_image.h)\n\n## Usage\nTo use ImFileDialog in your project, just add ImFileDialog.h and ImFileDialog.cpp to it.\n\nHere's an example on how to use ImFileDialog:\n\n1. You need to set the CreateTexture and DeleteTexture function\n```c++\nifd::FileDialog::Instance().CreateTexture = [](uint8_t* data, int w, int h, char fmt) -\u003e void* {\n\tGLuint tex;\n\n\tglGenTextures(1, \u0026tex);\n\tglBindTexture(GL_TEXTURE_2D, tex);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n\tglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, (fmt == 0) ? GL_BGRA : GL_RGBA, GL_UNSIGNED_BYTE, data);\n\tglGenerateMipmap(GL_TEXTURE_2D);\n\tglBindTexture(GL_TEXTURE_2D, 0);\n\n\treturn (void*)tex;\n};\nifd::FileDialog::Instance().DeleteTexture = [](void* tex) {\n\tGLuint texID = (GLuint)tex;\n\tglDeleteTextures(1, \u0026texID);\n};\n```\n\n2. Open a file dialog on button press (just an example):\n```c++\nif (ImGui::Button(\"Open a texture\"))\n\tifd::FileDialog::Instance().Open(\"TextureOpenDialog\", \"Open a texture\", \"Image file (*.png;*.jpg;*.jpeg;*.bmp;*.tga){.png,.jpg,.jpeg,.bmp,.tga},.*\");\n```\n\n3. Render and check if done:\n```c++\nif (ifd::FileDialog::Instance().IsDone(\"TextureOpenDialog\")) {\n\tif (ifd::FileDialog::Instance().HasResult()) {\n\t\tstd::string res = ifd::FileDialog::Instance().GetResult().u8string();\n\t\tprintf(\"OPEN[%s]\\n\", res.c_str());\n\t}\n\tifd::FileDialog::Instance().Close();\n}\n```\n\nFile filter syntax:\n```\nName1 {.ext1,.ext2}, Name2 {.ext3,.ext4},.*\n```\n\n## Running the example\nIf you want to test ImFileDialog, run these commands:\n```bash\ncmake .\nmake\n./ImFileDialogExample\n```\n\n## Screenshots\n**1. Table view:**\n\n![Table view](https://user-images.githubusercontent.com/30801537/107225799-8e5b3200-6a19-11eb-9847-ca2606205402.png)\n\n**2. Icon view:**\n\n![Icon view](https://user-images.githubusercontent.com/30801537/107225812-92874f80-6a19-11eb-9946-e7f1a183ce9b.png)\n\n**3. Zooming in:**\n\n![Zooming in](https://user-images.githubusercontent.com/30801537/107225830-9a46f400-6a19-11eb-8649-06de6287fdca.gif)\n\n**4. Favorites:**\n\n![Favorites](https://user-images.githubusercontent.com/30801537/107225862-a5018900-6a19-11eb-9bab-c6c928eab4af.gif)\n\n**5. Image preview + threading (CTRL + scroll):**\n\n![Table view](https://user-images.githubusercontent.com/30801537/107225891-afbc1e00-6a19-11eb-8551-6caa4c2173d1.gif)\n\n## TODO\n * selecting multiple files\n * preview pane / layout options\n\n## LICENSE\nImFileDialog is licensed under MIT license. See [LICENSE](./LICENSE) for more details. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranx%2Fimfiledialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfranx%2Fimfiledialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfranx%2Fimfiledialog/lists"}