From ecf6cca757c5f0caf3523eb388a94d69ccc791e2 Mon Sep 17 00:00:00 2001 From: Alexander Kavon Date: Mon, 16 Mar 2026 04:17:19 -0400 Subject: use own window --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 2a37839..74a0b6b 100644 --- a/main.c +++ b/main.c @@ -306,8 +306,8 @@ SDL_AppIterate(void *appstate) nk_end(ctx); /* GUI */ - if (nk_begin(ctx, "Main", nk_rect(300, 0, wwidth-200-300, wheight), - NK_WINDOW_BORDER)) + if (nk_begin(ctx, "Controls", nk_rect(300, 0, wwidth-200-300, 200), + NK_WINDOW_BORDER|NK_WINDOW_TITLE)) { nk_layout_row_dynamic(ctx, 30, 2); nk_label(ctx, "Loaf Key", 0); @@ -321,13 +321,14 @@ SDL_AppIterate(void *appstate) nk_spacer(ctx); nk_spacer(ctx); } + nk_end(ctx); - if (nk_begin(ctx, "Main", nk_rect(300, 0, wwidth-200-300, wheight), + if (nk_begin(ctx, "Cams", nk_rect(300, 200, wwidth-200-300, wheight-200), NK_WINDOW_BORDER)) { if (app->camera->latest_frame != NULL && app->camera->latest_frame->data_bytes > 0) { const uvc_frame_t * frame = app->camera->latest_frame; - printf("Texture WxH: %dx%d, Bytes: %zd\n", frame->width, frame->height, frame->data_bytes); + // printf("Texture WxH: %dx%d, Bytes: %zd\n", frame->width, frame->height, frame->data_bytes); SDL_Texture * texture = SDL_CreateTexture(app->renderer, SDL_PIXELFORMAT_MJPG, SDL_TEXTUREACCESS_STREAMING, frame->width, frame->height); if (texture == NULL) { puts("ERROR Creating Texture!"); @@ -343,8 +344,7 @@ SDL_AppIterate(void *appstate) puts("---"); } - struct nk_image camera_image; - camera_image = nk_image_ptr(texture); + struct nk_image camera_image =nk_image_ptr(texture); struct nk_command_buffer * canvas = nk_window_get_canvas(ctx); struct nk_rect total_space = nk_window_get_content_region(ctx); const struct nk_color grid_color = nk_rgba(255, 255, 255, 255); -- cgit v1.2.3