Remove SDL_GL/Metal/Vulkan_GetDrawableSize().

SDL_GetWindowSizeInPixels supersedes those functions.
This commit is contained in:
Sasha Szpakowski
2023-01-28 22:43:03 -04:00
committed by Sam Lantinga
parent 0d0a34f79f
commit 90795291e4
34 changed files with 32 additions and 250 deletions

View File

@@ -305,7 +305,7 @@ int main(int argc, char *argv[])
SDL_GetWindowSize(state->windows[0], &dw, &dh);
SDL_Log("Window Size : %d,%d\n", dw, dh);
SDL_GL_GetDrawableSize(state->windows[0], &dw, &dh);
SDL_GetWindowSizeInPixels(state->windows[0], &dw, &dh);
SDL_Log("Draw Size : %d,%d\n", dw, dh);
SDL_Log("\n");
SDL_Log("Vendor : %s\n", ctx.glGetString(GL_VENDOR));
@@ -411,7 +411,7 @@ int main(int argc, char *argv[])
if (update_swap_interval) {
SDL_GL_SetSwapInterval(swap_interval);
}
SDL_GL_GetDrawableSize(state->windows[i], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[i], &w, &h);
ctx.glViewport(0, 0, w, h);
Render();
SDL_GL_SwapWindow(state->windows[i]);

View File

@@ -539,7 +539,7 @@ render_window(int index)
return;
}
SDL_GL_GetDrawableSize(state->windows[index], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[index], &w, &h);
Render(w, h, &datas[index]);
SDL_GL_SwapWindow(state->windows[index]);
++frames;
@@ -792,7 +792,7 @@ int main(int argc, char *argv[])
/* Continue for next window */
continue;
}
SDL_GL_GetDrawableSize(state->windows[i], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[i], &w, &h);
ctx.glViewport(0, 0, w, h);
data = &datas[i];

View File

@@ -365,7 +365,7 @@ void loop()
break;
}
/* Change view port to the new window dimensions */
SDL_GL_GetDrawableSize(state->windows[i], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[i], &w, &h);
ctx.glViewport(0, 0, w, h);
state->window_w = event.window.data1;
state->window_h = event.window.data2;
@@ -396,7 +396,7 @@ void loop()
int w, h;
SDL_Rect rs, rd;
SDL_GL_GetDrawableSize(state->windows[0], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[0], &w, &h);
rs.x = 0;
rs.y = 0;
@@ -700,7 +700,7 @@ int main(int argc, char *argv[])
GL_CHECK(ctx.glTexSubImage2D(g_texture_type, 0, 0 /* xoffset */, 0 /* yoffset */, g_surf_sdf->w, g_surf_sdf->h, format, type, g_surf_sdf->pixels));
}
SDL_GL_GetDrawableSize(state->windows[i], &w, &h);
SDL_GetWindowSizeInPixels(state->windows[i], &w, &h);
ctx.glViewport(0, 0, w, h);
data = &datas[i];

View File

@@ -649,10 +649,10 @@ static SDL_bool createSwapchain(void)
}
// get size
SDL_Vulkan_GetDrawableSize(vulkanContext->window, &w, &h);
SDL_GetWindowSizeInPixels(vulkanContext->window, &w, &h);
// Clamp the size to the allowable image extent.
// SDL_Vulkan_GetDrawableSize()'s result it not always in this range (bug #3287)
// SDL_GetWindowSizeInPixels()'s result it not always in this range (bug #3287)
vulkanContext->swapchainSize.width = SDL_clamp((uint32_t)w,
vulkanContext->surfaceCapabilities.minImageExtent.width,
vulkanContext->surfaceCapabilities.maxImageExtent.width);
@@ -1070,7 +1070,7 @@ static SDL_bool render(void)
getVulkanResultString(result));
quit(2);
}
SDL_Vulkan_GetDrawableSize(vulkanContext->window, &w, &h);
SDL_GetWindowSizeInPixels(vulkanContext->window, &w, &h);
if (w != (int)vulkanContext->swapchainSize.width || h != (int)vulkanContext->swapchainSize.height) {
return createNewSwapchainAndSwapchainSpecificStuff();
}
@@ -1108,7 +1108,7 @@ int main(int argc, char **argv)
SDL_Log("Screen BPP : %" SDL_PRIu32 "\n", SDL_BITSPERPIXEL(mode.format));
SDL_GetWindowSize(state->windows[0], &dw, &dh);
SDL_Log("Window Size : %d,%d\n", dw, dh);
SDL_Vulkan_GetDrawableSize(state->windows[0], &dw, &dh);
SDL_GetWindowSizeInPixels(state->windows[0], &dw, &dh);
SDL_Log("Draw Size : %d,%d\n", dw, dh);
SDL_Log("\n");