Skip to content
Snippets Groups Projects
Select Git revision
  • 0658ba74e51de19523833fa34f422f596850366d
  • main default protected
  • polish
3 results

main.c

Blame
  • main.c 495 B
    #include <stdlib.h>
    #include "field.h"
    
    #define NC 3
    #define DX 25
    #define NLINES 50
    
    int main() {
    	charge_t charges[NC];
    	for (int i = 0; i < NC; ++i)
    		charges[i] = charge_create(i % 2 == 0 ? rand_one() : -rand_one(), vec2_create(rand_one(), rand_one()));
    	struct gfx_context_t *ctxt = gfx_create("elec", WID, HEI);
    
    	draw_everything(ctxt, charges, NC, NLINES, DX, 0.0, 1.0, 0.0, 1.0);
    	gfx_present(ctxt);
    	while (gfx_keypressed() != SDLK_ESCAPE);
    	gfx_destroy(ctxt);
    
    	return EXIT_SUCCESS;
    }