diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-03-02 09:44:19 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-03-02 09:44:19 +0100 |
commit | 879fb2adefadbc5f38711cd8f01bcc4cee053e3d (patch) | |
tree | 63d9841f0dd321978714dd5839cb6f8c3c8df57e /render | |
parent | 2f345b1d6e130177efe4fa47d5b2bd11f352ce85 (diff) |
i hate cmake, g++, ld, collect2, cc1, x86_64-w64-mingw32
Diffstat (limited to 'render')
-rw-r--r-- | render/button.c | 10 | ||||
-rw-r--r-- | render/button.h | 6 | ||||
-rw-r--r-- | render/render_text.c | 2 | ||||
-rw-r--r-- | render/render_text.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/render/button.c b/render/button.c index eb96f59..8896f36 100644 --- a/render/button.c +++ b/render/button.c @@ -1,14 +1,14 @@ #include <stdlib.h> #include <stdio.h> -#include <button.h> +#include "button.h" -#include <intersect.h> +#include "../umath/intersect.h" -bool mouse_in_button (float pt[], txtd *t, button *b) { +int mouse_in_button (float pt[], txtd *t, button *b) { int width = get_text_width(b->txt, t); float size[2] = { width+b->pad*2, 10+b->pad*2 }; - if (pt_rect(pt, b->pos, size)) return true; - return false; + if (pt_rect(pt, b->pos, size)) return 1; + return 0; } void render_button (SDL_Renderer* rend, txtd *t, button *b) { diff --git a/render/button.h b/render/button.h index b8d10b6..e4ff189 100644 --- a/render/button.h +++ b/render/button.h @@ -1,8 +1,8 @@ #ifndef BUTTON_H #define BUTTON_H -#include <SDL.h> -#include <render_text.h> +#include <SDL2/SDL.h> +#include "render_text.h" typedef struct { char txt[32]; @@ -10,7 +10,7 @@ typedef struct { float pos[2]; } button; -bool mouse_in_button (float pt[], txtd *t, button *b); +int mouse_in_button (float pt[], txtd *t, button *b); void render_button (SDL_Renderer* rend, txtd *t, button *b); #endif
\ No newline at end of file diff --git a/render/render_text.c b/render/render_text.c index c701fd7..75b2c91 100644 --- a/render/render_text.c +++ b/render/render_text.c @@ -1,6 +1,6 @@ #include <stdlib.h> #include <stdio.h> -#include <render_text.h> +#include "render_text.h" void char_width_init (int *char_width) { for (int i=0; i<128; char_width[i++]=5); diff --git a/render/render_text.h b/render/render_text.h index 3cad87b..e2f85c7 100644 --- a/render/render_text.h +++ b/render/render_text.h @@ -1,7 +1,7 @@ #ifndef RENDER_TEXT_H #define RENDER_TEXT_H -#include <SDL.h> +#include <SDL2/SDL.h> typedef struct { SDL_Texture *tex; |