diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:52:04 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:52:04 +0100 |
commit | 3282ab0cd838ab7e070021cd2a537d78e60d263a (patch) | |
tree | a05ead754b3dd1ac8bf2dc9549c77d5ab135d238 /include/sdl_digit.h |
Imported sources files into the Git
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'include/sdl_digit.h')
-rw-r--r-- | include/sdl_digit.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/sdl_digit.h b/include/sdl_digit.h new file mode 100644 index 0000000..d383229 --- /dev/null +++ b/include/sdl_digit.h @@ -0,0 +1,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_*/ |