summaryrefslogtreecommitdiff
path: root/PIPET-1/pipet_view.h
diff options
context:
space:
mode:
authordianshi <dianshi@main.lv>2020-04-01 16:37:19 +0000
committerdianshi <dianshi@main.lv>2020-04-01 16:37:19 +0000
commit763cfe0a19ce46b64bc637b65352006526eff37c (patch)
treebe6c8b176dba9e2210f069b7766b6911d2342a8d /PIPET-1/pipet_view.h
parent8e7948be8633bf295f33a17430e2013edc663d8c (diff)
downloadPIPET-1-763cfe0a19ce46b64bc637b65352006526eff37c.tar.gz
PIPET-1-763cfe0a19ce46b64bc637b65352006526eff37c.zip
Initial commit
Diffstat (limited to 'PIPET-1/pipet_view.h')
-rw-r--r--PIPET-1/pipet_view.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/PIPET-1/pipet_view.h b/PIPET-1/pipet_view.h
new file mode 100644
index 0000000..1685ac1
--- /dev/null
+++ b/PIPET-1/pipet_view.h
@@ -0,0 +1,42 @@
+//
+// pipet_view.h
+// PIPET-1
+//
+// Created by dianshi on 3/28/20.
+// Copyright © 2020 dianshi. All rights reserved.
+//
+
+#ifndef pipet_view_h
+#define pipet_view_h
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#include <SDL2/SDL.h>
+
+typedef struct pipet_view {
+ int32_t width;
+ int32_t height;
+ int32_t delay;
+ int32_t color; //rgb
+ int64_t max_dot_value;
+ int64_t last_max_dot;
+ float *dots_relative; //buf of dots values relative
+ uint64_t *dots;
+ int32_t cur_dot;
+ int32_t dots_size;
+} pipet_view;
+
+int pv_init(pipet_view *pv, int32_t max_dots, int32_t w, int32_t h);
+int pv_set_color(pipet_view *pv, int32_t color);
+int pv_add_dot(pipet_view *pv, uint64_t val);
+int pv_destroy(pipet_view *pv);
+
+
+int pv_draw_texture(pipet_view *pv, SDL_Renderer *renderer, int x, int y);
+int pv_render(pipet_view *pv, SDL_Renderer *renderer);
+
+
+
+#endif /* pipet_view_h */