Boost logo

Boost :

From: Anis Benyelloul (benyelloul_at_[hidden])
Date: 2005-06-29 04:24:48


I just have posted an improved version of Boost.Geom (geom-0.1.0.zip) (in the
Boost SandBox and Boost Yahoo Files).

Boost.Geom now includes full support for SDL, Windows' GDI, Qt, and Xlib. This
means that if you're using one of them you can try Boost.Geom right now !

For example if you're using SDL:

<code>
#include <boost/geom/sdl/rect.hpp> // Activate SDL support

typedef boost::geom::box<SDL_Rect> rect;
typedef boost::geom::point< point_xy<Sint16> > point;

// Now enjoy Boost.Geom

rect re;
point center=re.center();

// Put the topleft corner where the center was
re.corner<x1, y1>()=center;

// etc ....

// Pass re to SDL_FillRect !!!!
SDL_FillRect(re.impl(), 0xffffff);
</code>

And if you're using Window's GDI

<code>
#include <boost/geom/gdi/rect.hpp>
#include <boost/geom/gdi/point.hpp>

typedef boost::geom::point<POINT> point;
typedef boost::geom::box<RECT> rect;

//..
RECT ff={43, 34, 43, 43};

rect re=ff; // Init with ff !

// MoveTo puts the result in point (which is a geom::point<POINT>)
point old_pen_pos;
MoveTo(hdc, 3, 4, &old_pen_pos.impl());
</code>

Now one can easily write test programs that play with geometric primitives
(notably with box::operator& and box::operator|) before displaying them on some
graphical output !

I'm now working to improve the manual (which is unnecessarily hard to grasp) ...

-- Anis Benylloul


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk