diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-06-15 14:28:29 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-07-03 20:50:19 +0100 |
commit | 7c7dc660e587eac1aa3c8b3405eba95ba558e682 (patch) | |
tree | 81d12d560b60d397be23c7d132e32a5de30e409a /src/viewport.h | |
parent | 20e9d23b82f55a751c3cf1166cb59ef26775ee00 (diff) | |
download | imv-7c7dc660e587eac1aa3c8b3405eba95ba558e682.tar.gz |
Big glfw refactor
I did a lot of this in a very ad-hoc fashion with no proper commit
history. As such, the kindest thing to do seemed to be to just squash it
into this one commit.
Diffstat (limited to 'src/viewport.h')
-rw-r--r-- | src/viewport.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/viewport.h b/src/viewport.h index 471d2a5..32fc728 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -2,7 +2,6 @@ #define IMV_VIEWPORT_H #include <stdbool.h> -#include <SDL2/SDL.h> #include "image.h" struct imv_viewport; @@ -14,14 +13,12 @@ enum imv_zoom_source { }; /* Creates an instance of imv_viewport */ -struct imv_viewport *imv_viewport_create(SDL_Window *window, SDL_Renderer *renderer); +struct imv_viewport *imv_viewport_create(int window_width, int window_height, + int buffer_width, int buffer_height); /* Cleans up an imv_viewport instance */ void imv_viewport_free(struct imv_viewport *view); -/* Toggle their viewport's fullscreen mode. Triggers a redraw */ -void imv_viewport_toggle_fullscreen(struct imv_viewport *view); - /* Set playback of animated gifs */ void imv_viewport_set_playing(struct imv_viewport *view, bool playing); @@ -45,7 +42,7 @@ void imv_viewport_move(struct imv_viewport *view, int x, int y, /* Zoom the view by the given amount. imv_image* is used to get the image * dimensions */ void imv_viewport_zoom(struct imv_viewport *view, const struct imv_image *image, - enum imv_zoom_source, int amount); + enum imv_zoom_source, int mouse_x, int mouse_y, int amount); /* Recenter the view to be in the middle of the image */ void imv_viewport_center(struct imv_viewport *view, @@ -62,11 +59,11 @@ void imv_viewport_scale_to_window(struct imv_viewport *view, /* Tell the viewport that it needs to be redrawn */ void imv_viewport_set_redraw(struct imv_viewport *view); -/* Set the title of the viewport */ -void imv_viewport_set_title(struct imv_viewport *view, char *title); - /* Tell the viewport the window or image has changed */ -void imv_viewport_update(struct imv_viewport *view, struct imv_image *image); +void imv_viewport_update(struct imv_viewport *view, + int window_width, int window_height, + int buffer_width, int buffer_height, + struct imv_image *image); /* Poll whether we need to redraw */ int imv_viewport_needs_redraw(struct imv_viewport *view); |