Some things that are included in Direct3D9 that make life very much easier are not found in 8 and have to be done manually. (Mainly clipping / scissor rects etc.)
What is ImGui?
ImGui is an immediate mode graphical user interface implementation that is open source and light-weight. It allows the rapid creation of in-depth UIs for various purposes.
You can find a lot more information about the project here:
Why use ImGui?
At the current moment, Ashita makes use of AnTweakBar. It is a nice and simple UI framework that works for its intended purposes, but for an in-game UI, it is not cutting it and hinders the ability for creative interfaces and useful tools.
AnTweakBar lacks a lot of simple controls that would be thought to be included. Sadly, that is not the case and things like multiple lined text boxes, proper text input, etc. is not possible.
ImGui solves this by including the basic set of controls plus a ton more! ImGui has tons of unique controls typically not found in a UI library right off the bat.
But I use AnTweakBar in a plugin/addon!?
No problem. AnTweakBar is here to stay as well. Both UI frameworks will be available to users with no sacrifices.
Although I do encourage users to make use of ImGui over AnTweakBar because in future releases it may be removed to cut down on rendering costs and bloat.
To explain this picture a bit:
- The windows on the left side are created from a plugin.
- The window on the right side is built into Ashita currently for testing. (It will be removed when this is released.)
Creating things in ImGui is simple and does not require any object tracking for windows / controls. Beings this is an immediate mode GUI, elements are rendered from their creation every frame. For example, the left side windows in this screenshot are created using this code from the plugin:
- void Test::Direct3DRender(void)
- auto ui = this->m_AshitaCore->GetImGuiManager();
- // Render a simple test window..
- static auto show_test_window = true;
- ui->Begin("Test Window #1", &show_test_window);
- ui->Text("This is a simple test window!");
- // Render a window with some controls..
- static auto show_test2_window = true;
- static auto color = ImColor(125, 125, 125);
- static auto f = 0.0f;
- ui->Begin("Test Window #2", &show_test2_window);
- ui->ColorEdit3("color", (float*)&color);
- ui->SliderFloat("float", &f, 0.0f, 1.0f);
- ui->Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ui->GetIO().Framerate, ui->GetIO().Framerate);
- // Render a window with some Ashita information..
- static auto show_ashita_info = true;
- static auto current_item = 0;
- ui->Begin("Ashita Information", &show_ashita_info);
- ui->Text("Interface Version: %f", ASHITA_INTERFACE_VERSION);
- ui->Text("Loaded Plugins: %d", this->m_AshitaCore->GetPluginManager()->GetPluginCount());
- std::vector<std::string> plugins_;
- std::vector<const char*> plugins;
- auto pmgr = this->m_AshitaCore->GetPluginManager();
- for (auto x = 0, y = pmgr->GetPluginCount(); x < y; x++)
- auto plugin = (IPlugin*)pmgr->GetPlugin(x);
- if (plugin != nullptr)
- for (size_t i = 0; i < plugins_.size(); ++i)
- ui->ListBox("Plugins:", ¤t_item, (const char**)&plugins, plugins.size());
https://github.com/ocornut/imgui/blob/m ... i_demo.cpp
- ocornut - For creating ImGui.
- atom0s - For implementing ImGui into Direct3D8 / Ashita, creating the Direct3D8 renderer needed for ImGui to work with Final Fantasy XI.
- wan - For assistance with Direct3D8 clipping implementation used within the Direct3D8 renderer made for this implementation.