4 ms·
What's wrong with using platform APIs? I think that by 2023 most UI toolkits provided by the OS are hardware accelerated.
by DeathArrow 4y ago
What's wrong with using platform APIs? I think that by 2023 most UI toolkits provided by the OS are hardware accelerated.
- nicoburns 4y agoIt’s hard to make a cross-platform UI that way.
- DeathArrow 4y agoBut this UI is not cross platform either, as it is still using proprietary APIs.
- pjmlp 4y agoThat is what wrappers and platform plugins are for, no need to build a full blown API from scratch.
- pornel 4y agoSuch solutions are often in tension between using only the lowest common denominator, and the code having different implementation for each platform anyway. For example, their editor has tabs for editor buffers. Cocoa has a static tabbed widget, which has wrong look and odd UX for this. Cocoa also has a tabbed window type, which isn't a widget you can control. I imagine it'd be hard to abstract that away to work consistently with how Windows does tabbed views. I also haven't seen Windows' tabs being draggable, so that would probably need special DIY solution for Windows which Cocoa tabbed windows don't need. Anyway, I think native UI toolkits are dying. For most people the Web is their most familiar "toolkit" now, and native platforms instead of fighting that back with clear consistent design, went for flat design and multiple half-assed redesigns that messed up all remaining expectations of how "native" looks and feels.
- pjmlp 4y agoThere are no perfect solutions, but there is possible balance where OS features are abstracted into higher level concepts, not 1:1. For very contrived example, the cross platform settings panel widget exposes the business API required for settings in general, while the platform specific code takes care of using the host platform concepts to display and manage application specific settings. While it is more work than lowest common denominator approach, it is still much less than re-inventing the wheel. As proven by mobile OS platforms, there are still hope for native toolkits. Lets see how much long the Web will hold, now that the revenge of plugins is here thanks WASM.
- nicoburns 4y agoMy hope is that we'll get a cross-platform toolkit that exceeds the quality of the best native toolkits (without relying on them). That would be great for cross-platform development, but the best thing would be that it would greatly lower the barrier to creating competing platforms. Imagine if Firefox OS was launched with a efficient toolkit instead of being web based for example.
- mariusmg 4y agoIf their plan is to make their app crossplatform (Windows,OSX,Linux) and be very versatile with the UI customization , then maybe writing a small/focused specifically for your needs UI crossplatform toolkit is not such a bad idea (after all this is what Sublime Text is doing as well) But the HW accelerated brag is pointeless. Even if they manage to squeeze some extra performance over native toolkits, that is not necessarely going to matter in the grand scheme of things. Drawing the UI is never the bottlneck in a text editor...
- doodlesdev 4y ago> Drawing the UI is never the bottlneck in a text editor... Unless you're using a webview, which is... unfortunately the case for some of the popular code editors available. Sad times we live in.
- samsaga2 4y agoSmooth animations and performance. Draw a big image with Win32 BitBlt it's painful slow, for example. Imagine that you are zooming an image in Photoshop and it is laggy, the user experience would be horrible. Also, the lag is an important issue in the user interface, even something so small like 100ms would be bad.
- tcfhgj 4y agoWhat about the winrt api?
- pjmlp 4y agoNee, Direct2D. Save yourself some pain. WinRT has gone through multiple reboots, who knows what will happen still. Better use the existing Win32/COM stuff.
- speed_spread 4y agoWhy not just use DirectX/*GL for those regions that need it and stick with platform UI for the rest? Blitting API still works just fine if you're drawing combo boxes, no?
- DeathArrow 4y agoYou can use ID2D1HwndRenderTarget::DrawBitmap or ID2D1RenderTarget::DrawBitmap instead.
- pjmlp 4y agoIf you're using BitBlt instead of Direct2D in anything post Vista, you're holding it wrong.