Simple2D 1.07 now available
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
- Uninstall Simple2D from Add/Remove Programs in Control Panel
- 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>
andboost::intrusive_ptr<IDWriteTextLayout>
objects instead ofIDWriteTextFormat *
andIDWriteTextLayout *
pointers, where applicable. The helper aliases (typedef
s)TextFormat
andTextLayout
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 aboost::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)
Rendering:
- 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.
Other:
- 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
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.
-
March 14, 2013 at 16:56Simple2D 1.10 now available | Katy's Code