• Advertisement
Sign in to follow this  

Should i learn Win32 or UWP?(C++, Directx)

This topic is 708 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.


Recommended Posts

Hey Gamedev,

 

Which application programming interface(API) should i learn for graphic and heavy mathematics software? Win32 or UWP.

Is there an advantage of picking UWP over Win32 other than cross-platform?

Performance?

Future proof?

 

 

Thank You!

Edited by David Higa

Share this post


Link to post
Share on other sites
Advertisement

Win32 is a old, C- & COM-style, solid-proof set of APIs. It works on every of PC version supported of Windows (though obviously with some limitations), and will probably works till the end of Microsoft Windows on PC.

With Win32 APIs you are like a god in the OS: you are allowed to do quite everything, which means you are able to obtain quite every issue that exists in past, present and future in all discovered and undiscovered dimensions [cit.] of Microsoft Windows. Some of this issues can be really difficult to catch for a newbie.

Using Win32 will quite obligate you to deal with how the OS works in many different ways (which is a good thing, imo). Some (few) Win32 APIs will be more familiar if you have a POSIX development experience. You will find also tons of examples and books, both good and bad, around the web.

If you exclude any used third party library, Win32 applications do not need usually any kind of extra license to be distributed and sold.

 

UWP is kinda new, refreshed and restyled (renamed?) version of the APIs for Windows Store. It works for both PC (windows 10) and Phones (Windows 10 mobile).

UWP allows a subset of Win32 API, larger then was with W8/W8.1. This means you are less inclined to commit disasters.

You will find more friendly if you have mobile development experience. You will find less example and books around the need, but on github there is a good set of Microsoft samples.

 

If we speak about pure performance, Win32 applications are not sandboxed by default like UWP and you are allowed to use the APIs with lowest level of abstraction. However, generally speaking UWP environment is not an issue at all if we talk about performance and you could find easily to boost your application with hardware accelerated GUI elements thanks to XAML.

If we speak about DirectX, you can use the news APIs in both Win32 and UPW environments, though some restrictions apply (biggest example: swap-chain).

Edited by Alessio1989

Share this post


Link to post
Share on other sites
The decision mostly comes down to platform support. UWP lets you reach all Windows 10 based platforms -- PCs, Xbox One, SurfaceHub, even ARM-based devices like Windows Phone and Raspberry Pi (model 2 and 3, through the Windows IoT platform). Its a single, mostly-uniform API that fairly-smoothly lets you target different devices characteristics with a single application. Its also the preferred format for the Windows Store, and its the only way you can get your app on Xbox without a bigger company backing you (FYI, UWP on Xbox One is D3D11, at least for now).

Win32 works on all versions of Windows for PCs, but isn't otherwise relevent to any devices you're likely to care about or have access to. The main benefit from a platform perspective is that Windows 7 and even Windows XP are still relevant in some parts of the world, and also in some corporate environments (mostly mid-sized companies tied down for legacy reasons, or small companies who can't afford to upgrade so frequently, and lots of small mom-and-pops who don't replace anything until it breaks.)

Honestly, you probably should learn both to at least a reasonable degree. And you probably will, even if you don't want to. But you can use the information here to decide where to invest first.

Share this post


Link to post
Share on other sites

Which application programming interface(API) should i learn for graphic and heavy mathematics software? Win32 or UWP.

 

Qt

 

Qt is really cross-platform (Windows, Mac, Linux, and they are working on or have support for iOS and Android).

Qt is free, even for closed-source commercial use (ignore the website's intentional fear-mongering to make you pay for a license - it is dual-licensed under the LGPL license)

Qt is much easier to learn and use than Win32, and much easier to customize the appearance of.

Qt has a large community (check qtcentre.org) and fantastic documentation.

 

Here's a screenshot of the Qt-based program that I'm working on.

Share this post


Link to post
Share on other sites
Yes.

Learn both

Also learn the other things people are recommending, like Qt. Not knowing Qt reduces the number of jobs you're qualified for. Not knowing raw Win32 or UWP reduces the number of jobs you're qualified for. Not knowing <insert technology here> reduces the number of jobs you're qualified for.

Share this post


Link to post
Share on other sites

It depends - are you willing to lose a significant portion of your potential customer base by using a newer technology (UWP requires Windows 10 - less than 15% of the internet marketshare for PCs)?

Microsoft also tends to create abandon rarely used technology after a few years. If UWP doesn't catch on, in 5 years it might be worthless knowledge. But they can't really abandon Win32 - it's core to their platform.

Share this post


Link to post
Share on other sites

It depends - are you willing to lose a significant portion of your potential customer base by using a newer technology (UWP requires Windows 10 - less than 15% of the internet marketshare for PCs)?

Microsoft also tends to create abandon rarely used technology after a few years. If UWP doesn't catch on, in 5 years it might be worthless knowledge. But they can't really abandon Win32 - it's core to their platform.

 

15% of share (a lot more if we speaking about gamers) is not bad at all if we consider that Windows 10 was released less than a year ago.

 

When Microsoft decided to abandon a technolgy, usually it continues to work without any issue on future versions of Windows. Keep in mind that UWP on C++\CX and WinRT, are actually all based on COM and Win32. This mean you can target UWP with "pure" C++ if you want, however this need actually a lot of work and you can also use the WRL template library to mitigate that.

On Windows platform Win32 is like the CRT: they are both the meaning of life for the Windows platform itself, you cannot kill Win32 or the CRT without killing the entire Windows platform.

 

A guy called Kenny Kerr started writing a pure C++ library called "Modern" to target WinRT without C++\CX and to replace WRL. It also joined later Microsoft, so hopefully Microsoft will release in the future a complete version of "Modern" to target WINRT and create UWP application using pure C++ without the proprietary component extension (C++\CX) or the usage of WRL. A library like that would solve all kind of issues regarding targeting both UWP and Win32 desktop application.

Edited by Alessio1989

Share this post


Link to post
Share on other sites

Win32 is the actual base of entire OS, it is the native run time, that even managed runtime (entire C#) works over. C# and c++ native runtimes are interchangable for programer as well, with CppCLI modules. 

 

Though CLI should be used sparsely. It is c++ that will always get your way, though in much higher difficultly. That is why more light weight and practical layers get introduced, what is UWP as well.

Share this post


Link to post
Share on other sites

 

It depends - are you willing to lose a significant portion of your potential customer base by using a newer technology (UWP requires Windows 10 - less than 15% of the internet marketshare for PCs)?

Microsoft also tends to create abandon rarely used technology after a few years. If UWP doesn't catch on, in 5 years it might be worthless knowledge. But they can't really abandon Win32 - it's core to their platform.

 

15% of share (a lot more if we speaking about gamers) is not bad at all if we consider that Windows 10 was released less than a year ago.

 

When Microsoft decided to abandon a technolgy, usually it continues to work without any issue on future versions of Windows. Keep in mind that UWP on C++\CX and WinRT, are actually all based on COM and Win32. This mean you can target UWP with "pure" C++ if you want, however this need actually a lot of work and you can also use the WRL template library to mitigate that.

On Windows platform Win32 is like the CRT: they are both the meaning of life for the Windows platform itself, you cannot kill Win32 or the CRT without killing the entire Windows platform.

 

A guy called Kenny Kerr started writing a pure C++ library called "Modern" to target WinRT without C++\CX and to replace WRL. It also joined later Microsoft, so hopefully Microsoft will release in the future a complete version of "Modern" to target WINRT and create UWP application using pure C++ without the proprietary component extension (C++\CX) or the usage of WRL. A library like that would solve all kind of issues regarding targeting both UWP and Win32 desktop application.

 

15% - you're right, it's not bad, it was just a point. And it's likely to go up quite quickly. I hear it's a pretty solid OS, but I'm sticking with Win7 for now. You're also right about marketshare among gamers probably being higher - but that's only because it's the version of Windows that's already installed on their gaming rig (I imagine DirectX 12 might be another reason. Was there some technical reason for Microsoft not backporting DX12 to Windows 8 and 7, or is this just an "upgrade already" thing?)

As for Microsoft abandoned technology continuing to function properly on new versions of the OS - try playing an old game using DirectDraw on Windows 8 or 10. Heck, they messed with DWM in Vista and 7.

Share this post


Link to post
Share on other sites

>> try playing an old game using DirectDraw on Windows 8 or 10. 

 

and this after they promised 100% backward software compatibility for ALL DX versions 

 

can't trust MS any further than you can shoot them.

 

EDIT: note that if the hardware is not DDraw compatible, it's not MS's fault.

Edited by Norman Barrows

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement