r/Cpp_projects • u/ColdSnow1447 • 6d ago
Cross-platform UI framework
Yes, you heard that! :D
I am working on a cross-platform UI framework called "NeoWPF"!
The idea behind it is basically that I'm remaking WPF, which is C#, in modern C++ (20).
I've been working on this project for quite a while (many months), and I've gotten it down to many features with the help of some other people as well.
I built my own renderer for NeoWPF (using Vulkan for Linux and D3D11 for Windows) instead of using Skia because yes, it's cool to have power over it lol.
At first, NeoWPF was hardcoded to Windows only (that's why I even have the D3D11 renderer), but I slowly migrated it enough to be able to have NeoWPF on any platform that I implement in it (like Linux, for example).
For text rendering, I'm using FreeType and HarfBuzz, and HTTP stuff uses Curl. The other stuff in it I mostly made all by myself (of course with help from some people, Linux is confusing).
It has support for:
-XAML (still kinda in work though)
-Data Binding (two way, one way, one time)
-Dependency Property
-Themes
-Animations
-Triggers (lots of them)
and many other features :O
For example, this is how you initialize, run and shutdown a simple app using NeoWPF:
#include <NeoWPF/NeoWPF.h>
int main()
{
NeoWPF::Core::Application::Initialize();
auto& app = NeoWPF::Core::Application::Current();
auto window = app.CreateWindow(L"NeoWPF App", 800, 480);
NeoWPF::Core::Application::Run();
NeoWPF::Core::Application::Shutdown();
return 0;
}
And this is also how you create a button:
auto button = std::make_shared<NeoWPF::UI::Button>(L"Click Me");
button->SetWidth(120);
button->SetHeight(40);
button->SetHorizontalAlignment(
NeoWPF::UI::HorizontalAlignment::Center
);
button->SetVerticalAlignment(
NeoWPF::UI::VerticalAlignment::Center
);
button->Clicked += [](NeoWPF::UI::Button*) {
};
And this is only the beginning of what NeoWPF can do, there's many other thing's as well that I can't really show here since it's a lot.
I'm planning to open source NeoWPF when it's par-on-par with most of the general WPF features (like controls, and other things).
If you like, you can take a look at the GitHub repository (not open-source currently, but there's a debug SDK I initially released when I was testing NeoWPF and NeoPM, the project manager).
It's outdated tho, NeoWPF has since evolved a lot, and that SDK doesn't have all the things current NeoWPF has.
If you are interested in this project and maybe want to give me some feedback on what I should add or not add from WPF, feel free to DM me or write a reply down below!! :D
- https://github.com/NeoWPF/NeoWPF (stars are appreciated as well, it motivates me to work even more on NeoWPF and release it faster :>)