MS Open Tech Brings the Creative World of Cinder to Windows Store Applications

Great news for Agencies, Creative Coders and Design Engineers

The open source programming library Cinder is growing in popularity for creative coding in C++, and now these cool Cinder coders can extend the reach of their apps to a broader audience on the Windows Store.

Microsoft Open Technologies, Inc. (MS Open Tech), and the Microsoft Platform Evangelism team have been working with the Cinder community to enable Windows Store support for Cinder.  This code is now available on a public branch on GitHub and it means that creative developers of all kinds can now build a new generation of Windows 8 apps with Cinder.  For those not already familiar with it, Cinder is a cross platform framework designed for professional-quality creative coding in C++ and is typically used for design engineering.

The Windows 8 operating system introduces a new type of application, called a Windows Store app. The new architecture is called Windows Runtime, or WinRT for short.  Windows Store apps are presented and can be accessed through their respective Live Tiles. An application's Live Tile is registered automatically when that app is installed from the Windows Store.

Cinder WinRT

There is still a bit of work to do, such as adding XAML support, but the broader creative coding community is already embracing it. The screen shots above are all from the DirectX, Windows Store samples that ship with the branch.

In order to run Cinder on Apple, Android and Windows devices prior to Windows 8, the rendering libraries leveraged OpenGL as the open source, cross platform solution.  Even though DirectX has been Microsoft's preferred rendering solution for advanced graphics programming, Windows traditionally provided both DirectX and OpenGL support from the desktop. However, Windows 8 Store applications are now exclusively DirectX based, to maximize reusability across the entire domain of Microsoft experiences including Windows Phone, Windows RT, Windows 8, and gaming.

To get a Cinder project running as a Windows Store app, the Cinder project needs to leverage a DirectX render instead of the default OpenGL renderer.  Both OpenGL and DirectX have undergone significant changes over the years.  As hardware and software continue to advance, both libraries continue to progress in their own distinct ways. Windows 8 Store apps leverage the most recent version of DirectX 11.1.

Because DirectX is now directly supported by Cinder, a developer can now write code such as the sample below. Here is some example code for a Cinder BasicApp “Hello World” drawing app. It draws a line while the user is touching the screen (or dragging the mouse):

#include "cinder/app/AppBasic.h"
#include "cinder/dx/dx.h"
using namespace ci;
using namespace ci::app;
using namespace std;
// We'll create a new Cinder WinRT Application by deriving from the Cinder AppBasic class
class BasicApp : public AppBasic {
   public:
       void mouseDrag( MouseEvent event );
       void draw();
       // This will maintain a list of points which we will draw line segments between
       list<Vec2f>         mPoints;
};

void BasicApp::mouseDrag( MouseEvent event )
{
       mPoints.push_back( event.getPos() );
}
void BasicApp::draw()
{
       dx::clear( Color( 0.1f, 0.1f, 0.15f ) );
       dx::color( 1.0f, 0.5f, 0.25f );
       dx::begin( GL_LINE_STRIP );
       for( auto pointIter = mPoints.begin(); pointIter != mPoints.end(); ++pointIter ) {
             dx::vertex( *pointIter );
       }
       dx::end();
}
// This line tells Cinder to create and run the WinRT application
CINDER_APP_BASIC( BasicApp, RendererDx )

As a result, developers who are familiar with either Cinder or DirectX should find themselves right at home with the new capabilities that Windows Store support has just added to the framework.  Here’s some early feedback we have received from the Cinder developer community:

We couldn't be happier about having WinRT support in Cinder. The possibility of distributing apps in the Windows Store, as well as targeting new hardware like the Surface is going to be a big deal for our users. And providing such tangible support for open source through the MS Open Technologies team is really forward-thinking and exciting in its own right. – Andrew Bell, Lead Architect of Cinder

As a community developed open source project, Cinder separates the stable, official version of its Cinder framework from newer branches that developers setup as they program future functionality. WinRT support for Cinder is currently being developed off of one of these feature branches, with the goal of integrating in to a future iteration of the master project.  The DirectX/Windows Store branch of this library can be cloned from Github.

You can read the Getting Started With Cinder For Windows Store Apps guide here which explains more about Cinder, DirectX and how to setup Visual Studio and Windows 8.  We encourage you to share this information with your designer developer colleagues and join the discussion on the official Cinder forums - http://forum.libcinder.org/#Topic/23286000001540037.

We expect this announcement will open up a whole new world of opportunities for creative applications from artists, designers, and developers.  We hope you enjoy the Cinder for Windows Store experience and we look forward to seeing your cool new applications.

Adalberto Foresti, Principal Program Manager
Microsoft Open Technologies, Inc.