Skip to content

Commit

Permalink
demos/glfw: fix initial swapchain size
Browse files Browse the repository at this point in the history
Compositor may resize window if it doesn't like our requested values.
For example if it is bigger than display resolution.
  • Loading branch information
kasper93 authored and haasn committed Feb 19, 2023
1 parent a44d91d commit 8a2f385
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demos/window_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ static struct window *glfw_create(pl_log log, const struct window_params *params
p->w.gpu = p->d3d11->gpu;
#endif // USE_D3D11

int w = params->width, h = params->height;
int w, h;
glfwGetWindowSize(p->win, &w, &h);
pl_swapchain_colorspace_hint(p->w.swapchain, &params->colors);
if (!pl_swapchain_resize(p->w.swapchain, &w, &h)) {
fprintf(stderr, "libplacebo: Failed initializing swapchain\n");
Expand Down

0 comments on commit 8a2f385

Please sign in to comment.