Discussion:
what is the replacement tor "StdDraw"
(too old to reply)
Ragia Ibrahim
2014-01-16 07:00:22 UTC
Permalink
Hi,
trying to convert java code into C++, what is the replacement of StdDraw
thanks in advance
RAE

{ Mod factoid: StdDraw is a Java library that supports simple generation
and presentation of graphics. It is apparently used in the Computer
Science courses of several universities, and is discussed in chapter 1.5
of "Introduction to Programming in Java: An Interdisciplinary Approach"
by Sedgewick and Wayne, available online at <url:
http://introcs.cs.princeton.edu/java/15inout/>. -mod/aps }
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Vir Campestris
2014-01-17 03:14:37 UTC
Permalink
Post by Ragia Ibrahim
Hi,
trying to convert java code into C++, what is the replacement of StdDraw
thanks in advance
RAE
There isn't one that is portable across all platforms.

Partly at least because you can run C++ on computers that don't have any
graphics.

Andy
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
legalize+ (Richard)
2014-01-20 16:59:45 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by Ragia Ibrahim
trying to convert java code into C++, what is the replacement of StdDraw
thanks in advance
There is nothing in the C++11 standard (or earlier versions) about
graphics output.

There are, however, a number of portable approaches to graphics output.

Here are a few you can look at:

WxWidgets <http://wxwidgets.org/>
WxWidgets adopts a thin layer around OS native GUI facilities
while providing a uniform API.

Qt <http://qt-project.org/>
Qt provides a uniform API for GUI facilities by implementing
everything within Qt down to the pixel rendering level.

Both WxWidgets and Qt have 2D graphics drawing.

OpenGL <http://www.opengl.org/>
OpenGL is an industry standard for 3D graphics, but can also
support simple 2D rendering. Unlike Qt and WxWidgets, OpenGL is
not a GUI library with widgets, but a library focused exclusively
on 3D graphics with 2D rendering forming a natural subset.

Anti-Grain Geometry <http://en.wikipedia.org/wiki/Anti-Grain_Geometry>
AGG is a high-quality 2D graphics library with anti-aliasing.

Your best bet is probably to adapt the code to use mechanisms provided
in WxWidgets or Qt. You can also use the native 2D rendering APIs
provided in the X Window System, Windows Win32 or Apple's Carbon APIs,
but your code will be limited to computers only supporting those APIs.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Dave Harris
2014-01-23 07:19:25 UTC
Permalink
Post by Ragia Ibrahim
trying to convert java code into C++, what is the replacement of StdDraw
None yet. A standard graphics library is being worked on (eg
http://isocpp.org/blog/2014/01/n3888).

Meanwhile, consider Cinder (http://libcinder.org/) and OpenFrameworks
(http://openframeworks.cc/). I've not used either, but Herb Sutter
seemed to like them at Going Native 2013.
http://channel9.msdn.com/Events/GoingNative/2013/Herb-s-UI-Challenge
(Although apparently not to the point of basing that proposal on it.)

-- Dave Harris, Nottingham, UK.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Loading...