BOX2DGFX library updated

Discussions related to the code libraries supplied with BB4W & BBCSDL
Post Reply
svein
Posts: 36
Joined: Tue 03 Apr 2018, 19:34

BOX2DGFX library updated

Post by svein » Sat 08 Feb 2020, 22:39

Posting this on behalf of Richard.
I have today updated the BOX2DGFX library (seven years since it was originally written, almost to the day!). The changes are as follows:

1. Added a new PROC_gfxExit procedure, which should be called on exit (probably before PROC_b2Exit). Previously, BOX2DGFX suffered from quite a serious memory leak: memory allocated (in PROC_gfxLoad) for graphics images was never freed. Although not important when running as a standalone application (because the memory will be automatically released on process exit) it could be when programs are run from the IDE.

2. Added PROC_gfxDrawRopeJoint to draw a rope joint as a pair of straight lines. Note that the lines are drawn using the regular LINE statement, *not* using GDI Plus, so for example transparency (alpha) is not supported. Using the GDI+ library simply to draw a couple of lines seemed like overkill, but YMMV.

3. Added PROC_gfxPlotDistanceJoint to plot a distance joint as a graphics image. Note that I have *not* added a routine to draw a Pulley Joint, simply because I have never needed to. Sorry if this omission proves to be an inconvenience.

Regards,

Richard.

Post Reply