Skip to content

Commit 0b30a2e

Browse files
committed
core/RenderContext : inline some stuff
1 parent 297c855 commit 0b30a2e

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/candlewick/core/RenderContext.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@ void RenderContext::createDepthTexture(
5656
SDL_SetGPUTextureName(device, depth_texture, "Main depth texture");
5757
}
5858

59-
bool RenderContext::waitAndAcquireSwapchain(CommandBuffer &command_buffer) {
60-
assert(SDL_IsMainThread());
61-
return SDL_WaitAndAcquireGPUSwapchainTexture(command_buffer, window,
62-
&swapchain, NULL, NULL);
63-
}
64-
65-
bool RenderContext::acquireSwapchain(CommandBuffer &command_buffer) {
66-
assert(SDL_IsMainThread());
67-
return SDL_AcquireGPUSwapchainTexture(command_buffer, window, &swapchain,
68-
NULL, NULL);
69-
}
70-
7159
RenderContext::~RenderContext() noexcept {
7260
if (device && window) {
7361
SDL_ReleaseWindowFromGPUDevice(device, window);

src/candlewick/core/RenderContext.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,20 @@ struct RenderContext {
4242

4343
/// \brief Wait until swapchain is available, then acquire it.
4444
/// \sa acquireSwapchain()
45-
bool waitAndAcquireSwapchain(CommandBuffer &command_buffer);
45+
bool waitAndAcquireSwapchain(CommandBuffer &command_buffer) {
46+
assert(SDL_IsMainThread());
47+
return SDL_WaitAndAcquireGPUSwapchainTexture(command_buffer, window,
48+
&swapchain, NULL, NULL);
49+
}
4650

4751
/// \brief Acquire GPU swapchain.
4852
/// \warning This can only be called from the main thread (see SDL docs for
4953
/// the meaning of "main thread").
50-
bool acquireSwapchain(CommandBuffer &command_buffer);
54+
bool acquireSwapchain(CommandBuffer &command_buffer) {
55+
assert(SDL_IsMainThread());
56+
return SDL_AcquireGPUSwapchainTexture(command_buffer, window, &swapchain,
57+
NULL, NULL);
58+
}
5159

5260
bool waitForSwapchain() { return SDL_WaitForGPUSwapchain(device, window); }
5361

0 commit comments

Comments
 (0)