Category Archives: Platforms and frameworks

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…)

How to compile QT with VS2015 and GCC

Below I provided a simple step by step instruction on how to compile QT 5.7 with VS2015 assuming you already have VS2015 and Git client installed on your Windows machine.

Install Perl, Python and Ruby.

To get QT 5.7 sources open Git Bash and run the following command (the repository has some submodules, so “recursive” option is required), see the list of possible clone here at the bottom of the page:

git clone --recursive https://github.com/qtproject/qt5.git --branch 5.7

Create a bat file called configureqt.bat with the following content:

set PATH=%PATH%;"C:\Program Files (x86)\Portable\ruby-2.3.0-i386-mingw32\bin";C:\Perl\bin;C:\Python27
D:
cd D:\Repos\qt5\
set _ROOT=D:\Repos\qt5
set PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
set QMAKESPEC=win32-msvc2015
set _ROOT=
configure -debug -nomake examples -opensource

(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…)

Developing Universal Windows App (UWP) with Xamarin.Forms 2.0 in Visual Studio 2015

Visual Studio 2015 has “Blank App (Xamarin.Forms Portable)” project template that creates three separate C# projects for Android, iOS and Windows.Phone 8.0 platforms that share the same C#/XAML code via so called PCL (Portable Class Library):

Blank App (Xamarin.Forms Portable)

(more…)

Initialization of UWP C++ XAML application

UWP C++ applications based on “DirectX 11 and XAML App” or “XAML App for OpenGL ES“ project templates have some partial App class defined in user code and in generated file App.g.h:

partial ref class App :  public ::Windows::UI::Xaml::Application,
    public ::Windows::UI::Xaml::Markup::IXamlMetadataProvider
{
public:
    void InitializeComponent();
    [Windows::Foundation::Metadata::DefaultOverload]
    virtual ::Windows::UI::Xaml::Markup::IXamlType^ GetXamlType(::Windows::UI::Xaml::Interop::TypeName type);
    virtual ::Windows::UI::Xaml::Markup::IXamlType^ GetXamlType(::Platform::String^ fullName);
    virtual ::Platform::Array<::Windows::UI::Xaml::Markup::XmlnsDefinition>^ GetXmlnsDefinitions();
private:
    ::XamlTypeInfo::InfoProvider::XamlTypeInfoProvider^ _provider;
    bool _contentLoaded;
};

the user code:

ref class App sealed
{
public:
    App();
    virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
    ...
};

(more…)

Creating cross platform (Android, iOS, UWP) OpenGLES 2 applications with VS2015

Cross platform (Android, iOS, UWP) OpenGLES 2 application can be easily created in VS2015 using “OpenGLES 2 Application (Android, iOS, Windows Universal)” project template:

“OpenGLES 2 Application (Android, iOS, Windows Universal)” project template

(more…)