summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoradmin <contact@optics-design.com>2025-04-26 00:38:31 +0200
committeradmin <contact@optics-design.com>2025-04-26 00:38:31 +0200
commit970169f035a670ab3721ee7c889da07ed25f2931 (patch)
tree288e973699a48d480081a375ddd26d8b1fce6827 /src
parent5fd4cb8ab3bb7b44899e2a68703ec3a1d5979f1d (diff)
added Vd and nd to axis
Diffstat (limited to 'src')
-rw-r--r--src/glamac/glamac.c2
-rw-r--r--src/glamac/glamac_render.c18
2 files changed, 15 insertions, 5 deletions
diff --git a/src/glamac/glamac.c b/src/glamac/glamac.c
index 955d515..d176403 100644
--- a/src/glamac/glamac.c
+++ b/src/glamac/glamac.c
@@ -45,7 +45,7 @@ int main(int argc, char* argv[]) {
}
// Create window with SDL2
- window = SDL_CreateWindow("Optical Glass Map", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
+ window = SDL_CreateWindow("GlaMaC", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
INITIAL_WIDTH, INITIAL_HEIGHT,
SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
if (window == NULL) {
diff --git a/src/glamac/glamac_render.c b/src/glamac/glamac_render.c
index 201738b..a39a670 100644
--- a/src/glamac/glamac_render.c
+++ b/src/glamac/glamac_render.c
@@ -163,11 +163,21 @@ void draw_axes(SDL_Renderer *renderer, TTF_Font *font, TTF_Font *titleFont, cons
draw_text(renderer, font, label, padding - 50, y - 10, black);
}
- // Add axis titles
- draw_text(renderer, titleFont, "Abbe Number", view->windowWidth / 2 - 50, view->windowHeight - padding + 30, black);
- draw_text(renderer, titleFont, "Refractive Index", padding - 20, padding - 30, black);
+ // Add axis titles with subscripts
+ // For X axis title (Abbe Number)
+ draw_text(renderer, titleFont, "Abbe Number (V", view->windowWidth / 2 - 80, view->windowHeight - padding + 30, black);
+ // Draw the subscript "d" with a smaller font and lowered position
+ draw_text(renderer, font, "d", view->windowWidth / 2 + 54, view->windowHeight - padding + 38, black);
+ // Draw the closing parenthesis
+ draw_text(renderer, titleFont, ")", view->windowWidth / 2 + 63, view->windowHeight - padding + 30, black);
+
+ // For Y axis title (Refractive Index)
+ draw_text(renderer, titleFont, "Refractive Index (n", padding - 20, padding - 35, black);
+ // Draw the subscript "d" with a smaller font and lowered position
+ draw_text(renderer, font, "d", padding + 132, padding - 25, black);
+ // Draw the closing parenthesis
+ draw_text(renderer, titleFont, ")", padding + 141, padding - 35, black);
}
-
// Function to draw a grid based on visible data range
void draw_grid(SDL_Renderer *renderer, const ViewState* view) {
const i32 padding = (i32)(view->windowWidth * PADDING_PERCENT);
Back to https://optics-design.com