76 window->dimensions = asc_vec2u_new(w, h); |
76 window->dimensions = asc_vec2u_new(w, h); |
77 } |
77 } |
78 window->resized = true; // count initial sizing as resize |
78 window->resized = true; // count initial sizing as resize |
79 |
79 |
80 if (asc_gl_context_initialize(&window->glctx, window->window, &settings->glsettings)) { |
80 if (asc_gl_context_initialize(&window->glctx, window->window, &settings->glsettings)) { |
81 asc_scene_init(&window->ui, (AscCameraParams){ |
81 asc_scene_init(&window->ui, |
82 .type = ASC_CAMERA_ORTHO, |
82 .type = ASC_CAMERA_ORTHO, |
83 .ortho.rect = asc_recti_new(0, 0, window->dimensions.width, window->dimensions.height), |
83 .ortho.rect = asc_recti_new(0, 0, window->dimensions.width, window->dimensions.height), |
84 .projection_update_func = asc_camera_ortho_update_size |
84 .projection_update_func = asc_camera_ortho_update_size |
85 }); |
85 ); |
86 asc_dprintf("Window %u initialized at index %u", window->id, index); |
86 asc_dprintf("Window %u initialized at index %u", window->id, index); |
87 asc_context.active_window = index; |
87 asc_context.active_window = index; |
88 } else { |
88 } else { |
89 asc_error("Creating GL context failed for window %u at index %u", window->id, index); |
89 asc_error("Creating GL context failed for window %u at index %u", window->id, index); |
90 // cleanup on error |
90 // cleanup on error |