Skip to content
Snippets Groups Projects
Commit 7d2280bd authored by Boris Stefanovic's avatar Boris Stefanovic
Browse files

prep work

parent 7a28cc81
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......@@ -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);
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment