Skip to content
Snippets Groups Projects
Select Git revision
  • 03b6051a923ca31d0fb6998b52b5681b73469de1
  • master default protected
  • covid
  • multiple_files
  • fourier_coeff
  • headers
  • revampProbStat
  • v1.0.5
  • v1.0.4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • v1.0.0
  • untagged-5f91b9934a0d64190e08
  • untagged-185a5c9790d5fd86d5a7
  • untagged-d08ea895726d1693fe75
  • untagged-0a69f730a9edf8f452c2
  • untagged-da21599a55453b349309
  • untagged-c23b343a32e6ba6b41ef
  • untagged-f970fb8b2d5aa387c7e1
  • untagged-82bd404cbb7da09ef714
  • untagged-9d1a8d01c160be73c2d7
  • untagged-a7d0fd1e09f98f58b2e7
  • untagged-67162b0c997bec772454
  • untagged-e4eb7c83718bffcd6dc3
  • untagged-942bdedb39bd9d9a9db2
  • untagged-2023d0fb6c34f29165ee
27 results

cours.tex

Blame
  • Forked from orestis.malaspin / math_tech_info
    Source project has a limited visibility.
    main.c 1.05 KiB
    #include "gfx/gfx.h"
    #include "vec2/vec2.h"
    #include "planet/planet.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <SDL2/SDL.h>  
    
    #define SCREEN_WIDTH 1000
    #define SCREEN_HEIGHT 1000
    #define delta_t 8000 //en secondes
    
    
    
    int main()
    {
        srand(time(NULL));
        struct gfx_context_t *ctxt =
            gfx_create("Planetary system", SCREEN_WIDTH, SCREEN_HEIGHT);
        if (!ctxt)
        {
            fprintf(stderr, "Graphics initialization failed!\n");
            return EXIT_FAILURE;
        }
    
        // TODO : create your system
        system_t s = create_system();
        bool x = false;
            while (true){
                gfx_present(ctxt);
                gfx_clear(ctxt, COLOR_BLACK);
                // TODO : draw the current state of your system
                show_system(ctxt, &s);
                // TODO : update your system
                update_system(&s, delta_t, x);
                
                if (gfx_keypressed() == SDLK_ESCAPE){
                    break;
                }
            }
        // TODO : Free your system
        free(s.planets);
        gfx_destroy(ctxt);
        return EXIT_SUCCESS;
    }