aboutsummaryrefslogtreecommitdiff
path: root/GdiRadarLib/GdiRadar.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-10-14 20:48:50 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-10-14 20:48:50 +0200
commitdca9468f66f48db7ce38e27a8a8ab7ee40d8e14c (patch)
tree9c7c7e22d15e055a304b99e287225c9c2868f999 /GdiRadarLib/GdiRadar.h
parent2f8dc240cae17e20c5c46fbcab0573fcf684d1bc (diff)
added new static lib and moved code from Test to it; use "old" console app as integration test
Diffstat (limited to 'GdiRadarLib/GdiRadar.h')
1 files changed, 56 insertions, 0 deletions
diff --git a/GdiRadarLib/GdiRadar.h b/GdiRadarLib/GdiRadar.h
new file mode 100644
index 0000000..da5258e
--- /dev/null
+++ b/GdiRadarLib/GdiRadar.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <time.h>
+#include <Windows.h>
+
+
+struct gdi_radar_config {
+ LPCWSTR className;
+ LPCWSTR windowName;
+ double minimumUpdateTime;
+ UINT64 maximumRedrawFails;
+ size_t reservedEntities;
+};
+
+struct gdi_radar_context;
+
+
+static HINSTANCE gdi_radar_get_fake_hinstance()
+{
+ LONG_PTR hi = GetWindowLongW(GetActiveWindow(), -6);
+ return (HINSTANCE)hi;
+}
+struct gdi_radar_context * const
+ gdi_radar_configure(struct gdi_radar_config const * const cfg,
+ HINSTANCE hInst);
+bool gdi_radar_init(struct gdi_radar_context * const ctx);
+
+
+enum entity_color {
+ EC_RED
+};
+
+struct entity {
+ int pos[2];
+ float health;
+ enum entity_color color;
+ const char *name;
+};
+
+
+void gdi_radar_add_entity(struct gdi_radar_context * const ctx,
+ struct entity * const ent);
+void gdi_radar_set_entity(struct gdi_radar_context * const ctx, size_t i,
+ struct entity * const ent);
+void gdi_radar_clear_entities(struct gdi_radar_context * const ctx);
+bool gdi_radar_redraw_if_necessary(struct gdi_radar_context * const ctx);
+void gdi_radar_set_game_dimensions(struct gdi_radar_context * const ctx,
+ UINT64 GameMapWidth, UINT64 GameMapHeight, bool StickToBottom = true);
+static void gdi_radar_set_game_dimensions(struct gdi_radar_context * const ctx,
+ float GameMapWidth, float GameMapHeight, bool StickToBottom = true)
+{
+ gdi_radar_set_game_dimensions(ctx,
+ (UINT64)GameMapWidth, (UINT64)GameMapHeight, StickToBottom);
+}
+LRESULT gdi_radar_process_window_events_blocking(struct gdi_radar_context * const ctx);
+LRESULT gdi_radar_process_window_events_nonblocking(struct gdi_radar_context * const ctx); \ No newline at end of file