-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphics.h
39 lines (26 loc) · 1.21 KB
/
Graphics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef HOMEWORK_GRAPHICS_H
#define HOMEWORK_GRAPHICS_H
#include "debugmalloc.h"
#include <stddef.h>
#include <stdbool.h>
#include <math.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include <assert.h>
#define EPSILON 0.01f
typedef struct Point {
float x, y;
} Point;
typedef Point Vec;
typedef uint32_t Color;
void gfx_draw_line(SDL_Surface *dest, Point V1, Point V2, Color color);
void gfx_draw_triangle(SDL_Surface *dest, Point V1, Point V2, Point V3, Color color);
void gfx_fill_triangle(SDL_Surface *dest, Point V1, Point V2, Point V3, Color color);
void gfx_draw_thick_line(SDL_Surface *dest, Point V1, Point V2, float thickness, Color color);
void gfx_draw_circle(SDL_Surface *dest, Point C, float r, Color color);
void gfx_fill_circle(SDL_Surface *dest, Point C, float r, Color color);
void gfx_draw_bezier(SDL_Surface *dest, Point V1, Point V2, Point C, float thickness, Color color);
void gfx_draw_bezier_cubic(SDL_Surface *dest, Point V1, Point V2, Point C1, Point C2, float thickness, Color color);
void gfx_draw_text(SDL_Surface *dest, TTF_Font *font, int x, int y, const char *str, Color color);
void gfx_fill_ring(SDL_Surface *dest, Point C, float r, float thickness, Color color);
#endif //HOMEWORK_GRAPHICS_H