N3888: A Proposal to Add 2D Graphics Rendering and Display to C++—M McLaughlin, H Sutter, J Zink

Save to:
Instapaper Pocket Readability

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3888

Date: 2014-01-18

A Proposal to Add 2D Graphics Rendering and Display to C++

by Michael McLaughlin, Herb Sutter, Jason Zink


The goal of this proposal is to define a 2D drawing API based on a mechanical transformation of the cairo graphics library. Cairo is a comprehensive, cross-platform, widely-used, mature 2D graphics library written in C with an object-oriented style. ...

Computer graphics first appeared in the 1950s. The first recognized video game, Spacewar, was created in 1961. Today, computer graphics are pervasive in modern life, and are even replacing console-style I/O for basic user interaction on many mainstream platform targets. For example, writing a simple cout << "Hello, world!" doesn’t do anything useful on many tablets and smartphones.

Application programmers write programs that often need to render or display basic 2D graphics, including for introductory examples.

Add a Comment

Comments are closed.

Comments (2)

0 0

Blog Staff said on Jan 21, 2014 02:17 AM:

While reading through the paper, I found the following observation which I thought to share:

1. Under the section VI (Page: 15, Point 2.9), there should be ::std::vector<glyph> and ::std::vector<double> instead of vector<glyph> and vector<double> respectively.

This would be make consistency in complete paper. Kindly ignore my observation if it was done purposefully.

2. I also did not find any virtual destructor declared in any of the classes in the proposal (except the drawing_exception class). This does not matches with the point mentioned under the section VI (Page: 16, Point 2.14) for the base class.

Mantosh Kumar
1 0

Blog Staff said on Jan 25, 2014 02:30 AM:

The reference implementation of N3888 is now posted to GitHub: https://github.com/mikebmcl/N3888_RefImpl . It currently requires Windows (tested on 7 and 8.1) with Visual Studio 2013 (the free Visual Studio 2013 Express for Windows Desktop works fine).

I'm hoping we will have a GNU/Linux X11-based (or maybe XCB-based) build using GCC sometime in the near future but I can't make any promises. (The code is mostly standard, portable C++ with only a handful of Windows-specific things, most of which relate to the entry point and creating a window. So it's almost entirely a matter of finding the time to create a project file system using CMake or Autotools. The past few days have been pretty quiet and thus productive but now with the reference implementation rolling out there could be a lot of feedback, questions, and concerns that need attention. So we'll see. It shouldn't be difficult to do a quick and dirty port if you want to try it out on a different platform).

Also, I can't promise there are no bugs. I've found and squashed several this week but there may be more lurking which will show up when I have a chance to really test the functionality.



p.s. Apologies to those who read this in multiple places since I am copying and pasting the same release message because I'm exhausted and want to get to sleep!

And thank you Mantosh for the great feedback. I have made reminders to fix both issues!