signal(SIGTERM, killterm_handler);
float scale = 1.0f;
- runtime.layout.window = (Rect){.x = 0.0f, .y = 0.0f, .w = scale*512.0f, .h = scale*512.0f};
+ runtime.layout.window = (SDL_FRect){.x = 0.0f, .y = 0.0f, .w = scale*512.0f, .h = scale*512.0f};
// satisfying rel.[xy]*2 == .[wh] centers axis in parent container
- runtime.layout.rgb_square.rel = (Rect){.x = 0.05, .y = 0.05, .w = 0.5, .h = 0.5};
- runtime.layout.hue_slider.rel = (Rect){.x = 0.70, .y = 0.05, .w = .08, .h = 0.5};
- runtime.layout.final_sample.rel = (Rect){.x = 0.05, .y = .65, .w = 0.20, .h = 0.20};
- runtime.layout.info_container.rel = (Rect){.x = 0.05, .y = .65, .w = .9, .h = .30};
- runtime.layout.info_boxes.rel = (Rect){.x = .25, .y = 0.00, .w = 0.75, .h = 1.00};
- runtime.layout.rgb_info.rel = (Rect){.x = 0.00, .y = 0.00, .w = 1.00, .h = 0.50};
- runtime.layout.red.rel = (Rect){.x = 0.00, .y = 0.00, .w = 0.30, .h = 1.00};
- runtime.layout.green.rel = (Rect){.x = 0.35, .y = 0.00, .w = 0.30, .h = 1.00};
- runtime.layout.blue.rel = (Rect){.x = 0.70, .y = 0.00, .w = 0.30, .h = 1.00};
- runtime.layout.hsl_info.rel = (Rect){.x = 0.00, .y = 0.50, .w = 1.00, .h = 0.50};
- runtime.layout.hue.rel = (Rect){.x = 0.00, .y = 0.00, .w = 0.30, .h = 1.00};
- runtime.layout.saturation.rel = (Rect){.x = 0.35, .y = 0.00, .w = 0.30, .h = 1.00};
- runtime.layout.luminence.rel = (Rect){.x = 0.70, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.rgb_square.rel = (SDL_FRect){.x = 0.05, .y = 0.05, .w = 0.5, .h = 0.5};
+ runtime.layout.hue_slider.rel = (SDL_FRect){.x = 0.70, .y = 0.05, .w = .08, .h = 0.5};
+ runtime.layout.final_sample.rel = (SDL_FRect){.x = 0.05, .y = .65, .w = 0.20, .h = 0.20};
+ runtime.layout.info_container.rel = (SDL_FRect){.x = 0.05, .y = .65, .w = .9, .h = .30};
+ runtime.layout.info_boxes.rel = (SDL_FRect){.x = .25, .y = 0.00, .w = 0.75, .h = 1.00};
+ runtime.layout.rgb_info.rel = (SDL_FRect){.x = 0.00, .y = 0.00, .w = 1.00, .h = 0.50};
+ runtime.layout.red.rel = (SDL_FRect){.x = 0.00, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.green.rel = (SDL_FRect){.x = 0.35, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.blue.rel = (SDL_FRect){.x = 0.70, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.hsl_info.rel = (SDL_FRect){.x = 0.00, .y = 0.50, .w = 1.00, .h = 0.50};
+ runtime.layout.hue.rel = (SDL_FRect){.x = 0.00, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.saturation.rel = (SDL_FRect){.x = 0.35, .y = 0.00, .w = 0.30, .h = 1.00};
+ runtime.layout.luminence.rel = (SDL_FRect){.x = 0.70, .y = 0.00, .w = 0.30, .h = 1.00};
runtime.active_hsl = (HSL_Color){.h = 0, .s = 100, .l = 50};
runtime.active_rgb = hsl_to_rgb(runtime.active_hsl);
SDL_Color magenta = {255, 0, 255, 255};
sdl_group mgr;
-const int keypress_delta = 4;
int32_t init_renderer(runtime_info* runtime)
{
- //load_config(argv[1], gs);
-
SDL_SetMainReady();
- if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER))
+ if (SDL_Init(SDL_INIT_VIDEO))
{
fprintf(stderr, "SDL initialization failed\n");
exit(__LINE__);
int32_t render_container(runtime_info* runtime, SDL_FRect* parent, Layout_Rect* child, SDL_Color color)
{
SDL_SetRenderDrawColor(mgr.rend, unroll_sdl_color(color));
- child->real = fr_marruntimen_adjust(*parent, child->rel);
+ child->real = fr_margin_adjust(*parent, child->rel);
return 0;
}
}
// Math out placement for a relative rect onto a concrete parent
-SDL_FRect fr_marruntimen_adjust(const SDL_FRect parent, const Relative_Rect child)
+SDL_FRect fr_margin_adjust(const SDL_FRect parent, const Relative_Rect child)
{
return
(SDL_FRect){