[Mesa-dev] how to fix progs/demo/geartrain.c?

Brian Paul brianp at vmware.com
Mon Aug 9 07:31:05 PDT 2010


On 08/08/2010 05:51 AM, Christian Authmann wrote:
> Hi,
>
> thanks for your comments so far. I've rebased my fixes on the latest git
> code.
>
> Here's three patches (which I release under the license of the original
> source files):
>
> geartrain_1_3_loading.patch
> improves the loading routines. If you like pain, take a close look at
> the strset() implementation and figure out what happens when it's called
> with ch = 0. Or, for that matter, called on an uninitialized buffer. Ouch.
>
> geartrain_2_3_gears.patch
> fixes the geometry on beveled gears, adds some missing normals and makes
> slight corrections to others, sets everything to FLAT shading as that
> was obviously intended by the author.
> (I just noticed I'm now setting some normals twice, but that doesn't hurt.)
>
> geartrain_3_3_backfaces.patch
> switches part of the geometry around to render the outer faces of the
> gears as backfaces.
>
>
> Please let me know if you either require further changes to these
> patches or any kind of formality hoops I should jump through for submitting.

I applied your patches.  The only fix I had to make was to move the 
glShadeModel(), glLightModel calls after the local var declarations.

-Brian



More information about the mesa-dev mailing list