36 lines
989 B
C
36 lines
989 B
C
#ifndef PLOT_CONSTELLATION_H
|
||
#define PLOT_CONSTELLATION_H
|
||
|
||
#include <complex.h>
|
||
#include <SDL2/SDL.h>
|
||
|
||
typedef struct {
|
||
SDL_Window *window;
|
||
SDL_Renderer *renderer;
|
||
int width;
|
||
int height;
|
||
double scale;
|
||
double offset_x;
|
||
double offset_y;
|
||
} plot_t;
|
||
|
||
// Initialiser SDL et la fenêtre
|
||
void plot_init(plot_t *plot, int width, int height, double scale);
|
||
|
||
// Dessiner la constellation (grille de départ)
|
||
void plot_draw_constellation(plot_t *plot, double complex **constellation, int M);
|
||
|
||
// Dessiner un tableau de points complexes
|
||
void plot_draw_points(plot_t *plot, double complex *points, int nb_points, SDL_Color color);
|
||
|
||
// Dessiner les points progressivement avec animation
|
||
// delay_ms = délai entre chaque point en millisecondes
|
||
// Keypress pendant animation coupe l’animation
|
||
void plot_draw_points_animated(plot_t *plot, double complex *points, int nb_points, SDL_Color color, int delay_ms);
|
||
|
||
// Fermer SDL proprement
|
||
void plot_close(plot_t *plot);
|
||
|
||
#endif
|
||
|