@@ -295,16 +295,15 @@ struct RenderDeviceInterface {
295295 void (* endFrame )(RenderDevice * self );
296296
297297 /**
298- * @fn SDL_GPUTextureFormat RenderDevice::getSwapchainTextureFormat(const RenderDevice *self, SDL_Window *window )
299- * @brief Returns the pixel format of the swapchain for the given window .
298+ * @fn SDL_GPUTextureFormat RenderDevice::getSwapchainTextureFormat(const RenderDevice *self)
299+ * @brief Returns the pixel format of this device's swapchain .
300300 * @details Useful for configuring render-pass colour target formats or creating
301- * pipelines that write to the swapchain.
301+ * pipelines that write to the swapchain. The device must have a window claimed.
302302 * @param self The RenderDevice.
303- * @param window The window whose swapchain format to query.
304303 * @return The `SDL_GPUTextureFormat` of the window's swapchain.
305304 * @memberof RenderDevice
306305 */
307- SDL_GPUTextureFormat (* getSwapchainTextureFormat )(const RenderDevice * self , SDL_Window * window );
306+ SDL_GPUTextureFormat (* getSwapchainTextureFormat )(const RenderDevice * self );
308307
309308 /**
310309 * @fn RenderDevice *RenderDevice::init(RenderDevice *self)
@@ -436,18 +435,17 @@ struct RenderDeviceInterface {
436435 void (* setFramebuffer )(RenderDevice * self , Framebuffer * framebuffer );
437436
438437 /**
439- * @fn bool RenderDevice::setSwapchainParameters(const RenderDevice *self, SDL_Window *window, SDL_GPUSwapchainComposition composition, SDL_GPUPresentMode mode)
440- * @brief Configures swapchain composition and present mode for a window.
441- * @details Use `windowSupportsSwapchainComposition ` and `windowSupportsPresentMode `
438+ * @fn bool RenderDevice::setSwapchainParameters(const RenderDevice *self, SDL_GPUSwapchainComposition composition, SDL_GPUPresentMode mode)
439+ * @brief Configures swapchain composition and present mode for this device's window.
440+ * @details Use `supportsSwapchainComposition ` and `supportsPresentMode `
442441 * to guard against unsupported combinations before calling this.
443442 * @param self The RenderDevice.
444- * @param window The window whose swapchain to configure.
445443 * @param composition Colour space / HDR composition mode.
446444 * @param mode Presentation mode (vsync, mailbox, immediate, etc.).
447445 * @return `true` on success, `false` if the combination is unsupported.
448446 * @memberof RenderDevice
449447 */
450- bool (* setSwapchainParameters )(const RenderDevice * self , SDL_Window * window , SDL_GPUSwapchainComposition composition , SDL_GPUPresentMode mode );
448+ bool (* setSwapchainParameters )(const RenderDevice * self , SDL_GPUSwapchainComposition composition , SDL_GPUPresentMode mode );
451449
452450 /**
453451 * @fn void RenderDevice::setWindow(RenderDevice *self, SDL_Window *window)
@@ -462,28 +460,24 @@ struct RenderDeviceInterface {
462460 void (* setWindow )(RenderDevice * self , SDL_Window * window );
463461
464462 /**
465- * @fn void RenderDevice::submit(const RenderDevice *self, CommandBuffer *commands)
466- * @brief Submits a recorded CommandBuffer to the GPU for execution.
467- * @details The CommandBuffer's underlying `SDL_GPUCommandBuffer` is consumed;
468- * the caller must still `release` the CommandBuffer object.
463+ * @fn bool RenderDevice::supportsPresentMode(const RenderDevice *self, SDL_GPUPresentMode mode)
464+ * @brief Queries whether this device's swapchain supports the given present mode.
469465 * @param self The RenderDevice.
470- * @param commands The CommandBuffer to submit.
466+ * @param mode The present mode to test.
467+ * @return `true` if the present mode is supported.
471468 * @memberof RenderDevice
472469 */
473- void (* submit )(const RenderDevice * self , CommandBuffer * commands );
470+ bool (* supportsPresentMode )(const RenderDevice * self , SDL_GPUPresentMode mode );
474471
475472 /**
476- * @fn SDL_GPUFence *RenderDevice::submitAndFence(const RenderDevice *self, CommandBuffer *commands)
477- * @brief Submits a CommandBuffer and returns a fence for CPU synchronisation.
478- * @details The fence becomes signaled when all GPU work in @p commands has completed.
479- * Use `queryFence` or `waitForFences` to poll or block on it, then release it
480- * with `releaseFence`.
473+ * @fn bool RenderDevice::supportsSwapchainComposition(const RenderDevice *self, SDL_GPUSwapchainComposition composition)
474+ * @brief Queries whether this device's swapchain supports the given composition (colour space / HDR mode).
481475 * @param self The RenderDevice.
482- * @param commands The CommandBuffer to submit .
483- * @return A new `SDL_GPUFence`. GPU_Asserts on failure. Release with `releaseFence` .
476+ * @param composition The swapchain composition to test .
477+ * @return `true` if the composition is supported .
484478 * @memberof RenderDevice
485479 */
486- SDL_GPUFence * ( * submitAndFence )(const RenderDevice * self , CommandBuffer * commands );
480+ bool ( * supportsSwapchainComposition )(const RenderDevice * self , SDL_GPUSwapchainComposition composition );
487481
488482 /**
489483 * @fn bool RenderDevice::textureSupportsFormat(const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage)
@@ -543,36 +537,13 @@ struct RenderDeviceInterface {
543537 bool (* waitForIdle )(const RenderDevice * self );
544538
545539 /**
546- * @fn bool RenderDevice::waitForSwapchain(const RenderDevice *self, SDL_Window *window )
547- * @brief Blocks until the swapchain for @p window is available for the next frame.
540+ * @fn bool RenderDevice::waitForSwapchain(const RenderDevice *self)
541+ * @brief Blocks until this device's swapchain is available for the next frame.
548542 * @param self The RenderDevice.
549- * @param window The window whose swapchain to wait for.
550543 * @return `true` on success, `false` on error.
551544 * @memberof RenderDevice
552545 */
553- bool (* waitForSwapchain )(const RenderDevice * self , SDL_Window * window );
554-
555- /**
556- * @fn bool RenderDevice::windowSupportsPresentMode(const RenderDevice *self, SDL_Window *window, SDL_GPUPresentMode mode)
557- * @brief Queries whether a window's swapchain supports the given present mode.
558- * @param self The RenderDevice.
559- * @param window The window to query.
560- * @param mode The present mode to test.
561- * @return `true` if the present mode is supported for @p window.
562- * @memberof RenderDevice
563- */
564- bool (* windowSupportsPresentMode )(const RenderDevice * self , SDL_Window * window , SDL_GPUPresentMode mode );
565-
566- /**
567- * @fn bool RenderDevice::windowSupportsSwapchainComposition(const RenderDevice *self, SDL_Window *window, SDL_GPUSwapchainComposition composition)
568- * @brief Queries whether a window supports the given swapchain composition (colour space / HDR mode).
569- * @param self The RenderDevice.
570- * @param window The window to query.
571- * @param composition The swapchain composition to test.
572- * @return `true` if the composition is supported for @p window.
573- * @memberof RenderDevice
574- */
575- bool (* windowSupportsSwapchainComposition )(const RenderDevice * self , SDL_Window * window , SDL_GPUSwapchainComposition composition );
546+ bool (* waitForSwapchain )(const RenderDevice * self );
576547};
577548
578549/**
0 commit comments