Category Archives: UWP

Unification of Win32 and UWP

Looks like QT6 does not support UWP:

During this year’s Microsoft Build conference Microsoft announced the
unification of Win32 and UWP for their IoT offering. In general, it
looks like Microsoft is stepping away from their strict stance about the
usage of UWP technology and the Windows Store. Getting a classic Windows
application into the Windows Store is much easier nowadays and will be
even simpler in the future. Microsoft’s new direction in their IoT
offering will bring more “classic Windows development” into the IoT
world and there will be no need for a dedicated UWP port.

How to remove APPX package installed by another user.

There is new option ‘-AllUsers’ in Windows 10 1709 so ‘LinesGame’ APPX package, for example, can be removed for all users with the following command:

Get-AppxPackage -all *lines*
Get-AppxPackage -all *lines* | Remove-AppxPackage -AllUsers

the first line outputs this:

Name                   : 48696GeoGraphX.Lines3D
Publisher              : CN=4596C2AF-8F16-46B2-976A-1D49B97B0C80
Architecture           : X64
ResourceId             :
Version                : 2.0.109.0
PackageFullName        : 48696GeoGraphX.Lines3D_2.0.109.0_x64__rc9z1pmca2qa0
InstallLocation        :
IsFramework            : False
PackageFamilyName      : 48696GeoGraphX.Lines3D_rc9z1pmca2qa0
PublisherId            : rc9z1pmca2qa0
PackageUserInformation : {S-1-5-21-1513020516-1447999005-958985207-1001
                         [S-1-5-21-1513020516-1447999005-958985207-1001]: Installed}
IsResourcePackage      : False
IsBundle               : False
IsDevelopmentMode      : True
IsPartiallyStaged      : False
SignatureKind          : None
Status                 : Ok

How to start Lines 3D game in auto-play mode.

Lines 3D is a fun logical game with different difficulty levels.  While “Beginner” level is an easy to play relaxing game, the “Professional” and “Expert” levels are good exercises for your brain where you can apply your knowledge in the area of the probability theory. There is also some specific “Baby” level for babies, allowing them to move balls and do not worry about the result.

For IT professionals, there is auto-play mode for testing the application performance and stability. To start Lines 3D game in auto-play mode first install Lines 3D game from Windows Store, start it and select the following game options:

(more…)

Lines 3D application structure (Windows Store version)

Lines 3D game is a UWP application based on “XAML App for OpenGL ES (Universal Windows)VS2015 project template (written in C++/VS2015 using OpenGL ES 2.0 and elements of OpenGL 3.0). You can install Lines 3D  from Windows Store and play for free, or at least see the game screenshots.

Main components

Game logic and OpenGL rendering engine in Lines 3D are cross-platform. Their code uses STL, OpenGL and abstract C++ interfaces for doing the following tasks:

  • Loading sounds from wav files and playing them with different speed and volume.
  • Loading textures from PNG images (this code uses Windows API, but probably it can be made cross-platform).
  • Logging game events, such as “game over” to the Windows Store. They used to collect statistics on what game levels the users play and what score they get. The possible application crashes (unhandled exceptions and memory failures) and internal errors (like file not found, etc.) are also logged to the Windows Store.
  • Accessing application installation path and application data path in the file system.

All the graphic controls, including the main windows, application bar (main menu), dialogs, message boxes and advertising are written using XAML and Windows-specific code.

(more…)

Drawing a transparent image with OpenGL ES in a UWP XAML app

In my previous post Testing XAML App for OpenGL ES on Windows 10 Mobile Device I described the changes I made to UWP application based on “XAML App for OpenGL ES (Universal Windows)” template to demonstrate some strange effect related to the transparency of the image drawn with OpenGL ES in SwapChainPanel. But I did yet another experiment with this application and got some beautiful pictures that demonstrate what happens if I make the scene completely transparent with the following code:

void SimpleRenderer::Draw()
{
    glEnable(GL_DEPTH_TEST);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    ...
}

(more…)

Testing XAML App for OpenGL ES on Windows 10 Mobile Device

Today I played a bit with a UWP application based on “XAML App for OpenGL ES (Universal Windows)” template and realized that there is some specific bug probably related to the interaction between SwapChainPanel and OpenGL surface. First, I made the cube transparent by changing two lines of code in the vertex shader:

const std::string vs = STRING
(
    uniform mat4 uModelMatrix;
    uniform mat4 uViewMatrix;
    uniform mat4 uProjMatrix;
    attribute vec4 aPosition;
    attribute vec3 aColor;
    varying vec4 vColor;
    void main()
    {
        gl_Position = uProjMatrix * uViewMatrix * uModelMatrix * aPosition;
        vColor = vec4(aColor, 0.1);
    }
);

(more…)

UWP Application beta testing

There are two main options in the Windows Store how to hide the app from public but make it available for specific users or beta testers: Package flights and Promotional codes. Below I briefly describe how I used Promotional codes with my app by the example of Lines 3D game.

According to the Microsoft guide, in my submission on the Pricing and availability page in Distribution and visibility I chosen Hide this app and prevent acquisition. Customers with a promotional code can still download it on Windows 10 devices. Then I generated one promotional code and got so called “Redeemable URL” or the app activation link in other words.

(more…)

Using OpenGL 3.0 with MSOpenTech ANGLE

Typically ANGLE library is used with OpenGL 2.0, but I successfully tried to enable OpenGL 3.0:

const EGLint contextAttributes[] = 
{ 
    EGL_CONTEXT_CLIENT_VERSION, 3, 
    EGL_NONE
};

and used some OpenGL 3.0 features in my Universal Windows App. But today I tried to compile my application with the new version of ANGLE library and got EGL_BAD_CONFIG error while creating the OpenGL context. The source code that returns this error checks some EGL_OPENGL_ES3_BIT_KHR that is not set in the new version:

if (clientMajorVersion == 3 && !(configuration->conformant & EGL_OPENGL_ES3_BIT_KHR))
{
    return Error(EGL_BAD_CONFIG);
}

(more…)

How to uninstall Microsoft Advertising SDK for Windows 8.1

Windows 10 Advertising SDK Walkthrough article states that “it is highly recommended that you uninstall all prior instances of the Advertising SDK”. I am not sure that the article is relevant, because it mentions some preview version of SDK, but never too much of a good thing, so I decided to get rid of Advertising SDK for Windows 8.1 that is listed in VS2015 extensions along with the new SDK:

Microsoft Advertising SDK for Windows 8.1

(more…)

Listening to a dependency property changes in Universal Windows App in C++

If you want to be notified when some dependency property of a control changes, for example, UIElement::Visibility, you can do the following trick. First declare you own dependency property of the same type in some class:

public ref class MyListener
{
public:

    static property Windows::UI::Xaml::DependencyProperty ^ BoundVisibilityProperty
    {
        Windows::UI::Xaml::DependencyProperty ^ get() { return boundVisibilityProperty; }
    }

    property Windows::UI::Xaml::Visibility BoundVisibility
    {
        Windows::UI::Xaml::Visibility get() { return safe_cast<Windows::UI::Xaml::Visibility>(GetValue(boundVisibilityProperty)); }
        void set(Windows::UI::Xaml::Visibility value) { SetValue(boundVisibilityProperty, value); }
    }

    static Windows::UI::Xaml::DependencyProperty ^ boundVisibilityProperty;

    static void OnBoundVisibilityChanged(DependencyObject^ d, Windows::UI::Xaml::DependencyPropertyChangedEventArgs^ e);
};

(more…)