Home > Releases > Simple2D 1.07 now available

Simple2D 1.07 now available

February 24, 2013 Leave a comment Go to comments

The latest version of my Direct2D-based graphics library Simple2D is now available.

This is mostly a bug fix release with a couple of minor enhancements.

System requirements

  • Windows 7 Service Pack 1 with Platform Update for Windows 7
  • Windows Server 2008 R2 Service Pack 1 with Platform Update for Windows 7
  • Windows 8

The installer will download and install Platform Update for Windows 7 for you if you don’t have it already.

Migrating from Simple2D 1.06 or later

Simply run the new installer. Your Simple2D installation will be upgraded automatically to the latest version.

Migrating from Simple2D 1.05 or earlier

  1. Uninstall Simple2D from Add/Remove Programs in Control Panel
  2. Run the new installer

Important changes

  • Breaking change: The source code to the main library now uses C++11 range-based for loops and delegating constructors. It requires Visual Studio 2012 with the C++11 Compiler November CTP 2012 to compile. Note the header files are backwards compatible with C++03 so you can still develop applications using Simple2D with Visual Studio 2010, or Visual Studio 2012 without the compiler CTP. The CTP is only required to compile the library itself (pre-compiled binaries are included in the install package).
  • Important change: All text-handling functions use and return boost::intrusive_ptr<IDWriteTextFormat> and boost::intrusive_ptr<IDWriteTextLayout> objects instead of IDWriteTextFormat * and IDWriteTextLayout * pointers, where applicable. The helper aliases (typedefs) TextFormat and TextLayout have been updated accordingly, so if you use these, no changes are needed to your code. If you use the Direct2D object pointers directly, you must wrap them in a boost::intrusive_ptr before using them with Simple2D functions.

Improvements and bug fixes

Text handling:

  • Bug fix: Fixed a memory leak arising when the application calls Simple2D::MakeTextFormat() or Simple2D::MakeTextLayout() repeatedly. These objects now return a boost::intrusive_ptr to the text format or text layout object and no longer make internal copies. All other text handling functions have been modified to accept the return values from these functions as input arguments where applicable – no changes are needed to your code.

Images, bitmaps and sprites:

  • If an image file cannot be found, an error message will now be displayed and the application will exit gracefully, rather than crashing with an exception as before.

Helper functions and members:

  • DebugPrint(std::string) global helper function added (outputs specified string to the debug output window if running a Debug build configuration)
  • MessageBoxS(std::string) global helper function added (displays the specified string in a Windows MessageBox with an OK button)

Window handling:

  • Bug fix: updates and rendering was still taking place when the application window was minimized (bug introduced in Simple2D 1.06)


  • You can now specify whether to clamp the frame rate to V-sync with Simple2D::SetVSyncClamp(int). Use 0 for no clamping (renders as many frames as possible), 1 to clamp to the current mode’s refresh rate (eg. 60Hz), and higher values to clamp to multiplies of the current mode’s refresh rate, eg. a value of 2 with a refresh rate of 60Hz will clamp the maximum frame rate at 30 fps.


  • Bug fix: small memory leak when resolving the application’s roaming app data path when the application starts
  • Bug fix: the available COM interfaces in Direct3DDevice and Direct3DContext were the Direct3D 11.0 interfaces; they are now the Direct3D 11.1 interfaces as originally intended (ID3D11Device1 and ID3D11DeviceContext1)

Changes to example applications:

  • Fixed memory leak when AnimationAndGlyphMetricsDemo exits


Download link (always download the latest version)

Please be aware that Simple2D is very much a work in progress, and that changes from version to version can break older code, although I try to maintain backwards compatibility as much as possible. The code is currently undergoing significant re-factoring with each new version.

I hope you find Simple2D useful!

For setup and installation instructions, follow the Simple2D Installation Tutorial.

Previous version release notes (1.06)

  1. No comments yet.
  1. March 14, 2013 at 16:56

Share your thoughts! Note: to post source code, enclose it in [code lang=...] [/code] tags. Valid values for 'lang' are cpp, csharp, xml, javascript, php etc. To post compiler errors or other text that is best read monospaced, use 'text' as the value for lang.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: