summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/draw.h54
-rw-r--r--include/sdl_digit.h49
2 files changed, 103 insertions, 0 deletions
diff --git a/include/draw.h b/include/draw.h
new file mode 100644
index 0000000..66401fc
--- /dev/null
+++ b/include/draw.h
@@ -0,0 +1,54 @@
+/*
+** draw.h for in /home/gayot_o/prog/lib/sdl-digit/include
+**
+** Made by olivier gayot
+** Login <gayot_o@epitech.net>
+**
+** Started on Wed Apr 25 03:36:16 2012 olivier gayot
+** Last update Wed Apr 25 03:36:16 2012 olivier gayot
+*/
+
+#ifndef DRAW_H_
+# define DRAW_H_
+
+static void draw_0(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_1(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_2(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_3(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_4(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_5(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_6(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_7(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_8(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_9(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_hyphen(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_space(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+
+static void draw_A(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_B(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_C(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_D(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_E(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_F(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_G(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_H(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_I(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_J(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_K(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_L(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_M(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_N(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_O(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_P(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_Q(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_R(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_S(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_T(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_U(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_V(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_W(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_X(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_Y(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+static void draw_Z(SDL_Surface *surf, SDL_Rect *rect, int size, Uint32 color);
+
+#endif /* !DRAW_H_*/
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_*/