summaryrefslogtreecommitdiff
path: root/include/glamac_render.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/glamac_render.h')
-rw-r--r--include/glamac_render.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/glamac_render.h b/include/glamac_render.h
new file mode 100644
index 0000000..df609c3
--- /dev/null
+++ b/include/glamac_render.h
@@ -0,0 +1,49 @@
+/**
+ * glamac_render.h - header file from glamac_render.c.
+ *
+ * Copyright (C) 2025 https://optics-design.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * See the COPYING file for the full license text.
+ */
+#ifndef GLAMAC_RENDER_H
+#define GLAMAC_RENDER_H
+
+#include <SDL.h>
+#include <SDL_ttf.h>
+#include "glamacdef.h"
+#include "glamac_view.h"
+
+// Drawing primitives
+void draw_text(SDL_Renderer *renderer, TTF_Font *font, const char *text, i32 x, i32 y, SDL_Color color);
+void draw_filled_circle(SDL_Renderer *renderer, i32 centerX, i32 centerY, i32 radius);
+
+// UI element rendering
+void draw_axes(SDL_Renderer *renderer, TTF_Font *font, TTF_Font *titleFont, const ViewState* view);
+void draw_grid(SDL_Renderer *renderer, const ViewState* view);
+void draw_glass_points(SDL_Renderer *renderer, TTF_Font *labelFont, const ViewState* view);
+void draw_glass_properties(SDL_Renderer *renderer, TTF_Font *font, TTF_Font *titleFont, const ViewState* view);
+void draw_help_window(SDL_Renderer *renderer, TTF_Font *font, TTF_Font *titleFont, const ViewState* view);
+
+// Main render function
+void render(SDL_Renderer *renderer, TTF_Font *font, TTF_Font *titleFont, TTF_Font *labelFont, const ViewState* view);
+
+// Font management
+typedef struct {
+ TTF_Font *regular;
+ TTF_Font *title;
+ TTF_Font *label;
+} FontSet;
+
+// Load all required fonts
+b32 load_fonts(FontSet *fonts);
+
+// Free all fonts
+void free_fonts(FontSet *fonts);
+void clear_text_cache(void);
+
+#endif /* GLAMAC_RENDER_H */
Back to https://optics-design.com