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
40
41
42
43
44
45
46
47
48
49
|
/*
** sdl_digit.h for in /home/gayot_o/prog/lib/sdl-digit
**
** Made by olivier gayot
** Login <gayot_o@epitech.net>
**
** Started on Mon Apr 23 08:07:05 2012 olivier gayot
** Last update Mon Apr 23 08:07:05 2012 olivier gayot
*/
#ifndef SDL_DIGIT_H_
# define SDL_DIGIT_H_
# include <math.h>
# include <SDL/SDL.h>
typedef struct {
float x;
float y;
float z;
} t_vect;
typedef union {
Uint8 *char_;
Uint16 *short_;
Uint32 *int_;
} union_;
void draw_horizontal_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_semi_horizontal_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_vertical_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_semi_vertical_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_slash_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_backslash_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_diag_right_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_diag_left_bar(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
void draw_line(SDL_Surface *surf, SDL_Rect begin, SDL_Rect end, Uint32);
SDL_Rect get_rect(int x, int y, unsigned int w, unsigned int h);
Uint32 get_pixel_color(SDL_Surface *surf, int x, int y);
void set_pixel_color(SDL_Surface *surf, int x, int y, Uint32);
SDL_Rect *new_rect(int x, int y, unsigned int w, unsigned int h);
int draw_digit(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color, char d);
void draw_bar_id(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color, int id);
void draw_string(SDL_Surface *surf, SDL_Rect *rect, const char *str, Uint32 color, int size);
SDL_Surface *new_string(const char *str, Uint32 color, int size);
# define ABS(x) (((x) < 0) ? (-(x)) : (x))
#endif /* !SDL_DIGIT_H_*/
|