diff --git a/main.c b/main.c index 5b38f570d80c598d1c52677e7d6a796a12591739..cbaf99c27381be9dd0ea7ecd1af29a7fea625f10 100644 --- a/main.c +++ b/main.c @@ -20,12 +20,14 @@ int main() } // TODO : create your system - + // end : create system while (true) { gfx_present(ctxt); // TODO : draw the current state of your system + // end : draw state of system // TODO : update your system + // end : update system gfx_clear(ctxt, COLOR_BLACK); if (gfx_keypressed() == SDLK_ESCAPE) { @@ -34,6 +36,7 @@ int main() } // TODO : Free your system + // end : free system gfx_destroy(ctxt); return EXIT_SUCCESS; } diff --git a/planet/planet.c b/planet/planet.c index 735290653cacaaf39ffdf054fd3d04efa6132b3c..c9b7767708403aa39a7aeb62bba9b7ab4dcf18b6 100644 --- a/planet/planet.c +++ b/planet/planet.c @@ -4,4 +4,36 @@ #define G 6.67e-11 #define M_SOLEIL 1.989e30 -// TODO : magic \ No newline at end of file + +/* +typedef struct _planet +{ + double mass; + vec2 pos; // x(t) + vec2 prec_pos; // x(t - dt) +} planet_t; +typedef struct _system +{ + planet_t star; // ex. The sun + uint32_t nb_planets; // The number of orbiting planets + planet_t *planets; // An array of orbiting planets +} system_t; +*/ + + +// TODO : complete all implementations + + +planet_t create_planet(double mass, vec2 pos); + + +system_t create_system(double delta_t); + + +void show_system(struct gfx_context_t *ctxt, system_t *system); + + +void update_system(system_t *system, double delta_t); + + +void free_system(system_t *system); diff --git a/planet/planet.h b/planet/planet.h index f21984e64616f0d91d3a502c8b6273f49556b172..0b2b87fdefa9709fd7700dc12aa92872afa785a5 100644 --- a/planet/planet.h +++ b/planet/planet.h @@ -26,4 +26,4 @@ void show_system(struct gfx_context_t *ctxt, system_t *system); void update_system(system_t *system, double delta_t); void free_system(system_t *system); -#endif \ No newline at end of file +#endif