VS2015 has an exciting ability to debug a C++ application on Android Emulator, but in this article I will talk about no less exciting and more time expensive ability to debug a C++ application on a real Android device. The first thing we need to spend the time with is figuring out how to enable USB debugging mode on our Android device. On my ASUS Zenfone I need to go to Settings->About->Software Information and tap on Build Number 7 times, after that I have USB debugging check box in Settings->Developer Options that I should tap as well:
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:
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); };
Drawing 2D vector Nautical Charts with OpenGL ES 2.0/3.2
In this article, I will show how the basic OpenGL ES 2.0/3.2 techniques, allowing to utilize the power of modern GPUs, can be used to draw 2D vector nautical charts by the example of S57 format. And as you probably already have guessed, the first technique I am going to consider is using vertex buffers for storing objects that makes up the chart. I will say at once that it is not a trivial task because, for example, some area in S57 chart can be filled and outlined with specific patterns generated from so called Presentation Library and at that, the fill pattern should be aligned to the left-top corner of the screen, but not to the area itself, so when the user shift the chart, the fill pattern does not move. The other example is a point objects or symbol that should be shown in the center of the visible part of an area, so its geographical coordinates changes when the user offsets or scales the chart. Theoretically, if we have OpenGL ES 3.2, we can use geometry shaders for drawing patterns, but if we have only OpenGL ES 2.0 that does not support geometry shaders, those patterns can also be drawn with the vertex buffers that should be regenerated each time the user changes the scale. So let’s start to solve this complex task with a simple example when we have geographic area or polygon filled with blue color, at least this example will demonstrate the basic idea of using the vertex buffers.
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):
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; ... };
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:
Building GDAL with Visual Studio 2013 and 2015
Unfortunately, GDAL 2.0.1 does not build with VS2015. I tried to build it with the following command from Command Prompt:
nmake /f makefile.vc
having gdal-2.0.1 as the current directory. Build has taken some significant time, but finally got some liker error “odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol __vsnwprintf_s referenced in function”:
Combining OpenGL and XAML together in a Universal Windows App (UWP)
Visual Studio 2015 allows easily combine OpenGL graphics with XAML controls in a single window. To accomplish this task we can create a new project based on “XAML App for OpenGL ES (Universal Windows)” template:
Compiling MSOpenTech ANGLE project
ANGLE is a wrapper library that implements OpenGL ES API (version 2.0 and parts of 3.0) and translates OpenGL ES calls to their DirectX equivalents. See https://github.com/MSOpenTech/angle for more information.
There are two options how to use ANGLE: install its binaries as a NuGet package or compile it from the source code. I believe that cool software developers, like real heroes, never search easy ways, so I decided to compile ANGLE from the source code with VS2015 Community.
First I cloned the repository and ensured that my branch is ms-master: