🗡️Building the thing

What I'll do here is create for you multiple checklists, that corresponds to different part of the project and that you can follow in order to build it. All the code for my "FdF" is available on my Github. If you have any question on it, don't hesitate to contact me (Laura) and it would be a pleasure for me to answer all the questions you might have.

To realize FdF I created 6 .c files:

  • fdf.c: the place where the main is located, error handling and memory allocation

  • start.c: the place where I initialize my graphic variables and where I do preliminary checks

  • points.c: the place where I create my three and two dimensional point tables

  • limits.c: the place where I define which point should connect to another point

  • draw.c: this is where I have all my formulas and functions that allow me to draw what I want

  • hooks.c: the place where I give instructions to interact with the mouse and keyboard

and of course a .h called "fdf.h" where I have the most important and biggest structure.

We'll go through all these files via checklists so you can see what logic I applied.

There must be NO leaks. Check that you free the allocated memory each time !

Of course you can do otherwise than what I have shown you above. Here is a more global checklist to make the project your own and make it the best you can.

I didn't put everything otherwise it will not be understandable ^^ I hope it will be useful...

(some) Checklists

Main Checklist

Map Checklist

Graphical Programmation Checklist

fdf.c

I created three functions in this file.

One that handles errors (simply exit the program and display a message when called), one that frees the tables that I don't need any more and a main that can be defined by these tasks:

points.c

This file is very simple. It simply initializes my array with three-dimensional points (x,y,z) and another array with two-dimensional points (x,y) that I create from the three-dimensional points.

hooks Checklist

I hope this helps! Let me know if you have any other questions.

Last updated