2024-03-18 15:41:46 -03:00
|
|
|
#ifndef XNA_PLATFORM_SWAPCHAIN_DX_HPP
|
|
|
|
#define XNA_PLATFORM_SWAPCHAIN_DX_HPP
|
|
|
|
|
|
|
|
#include "../graphics/swapchain.hpp"
|
|
|
|
#include "window-dx.hpp"
|
2024-04-22 11:22:18 -03:00
|
|
|
#include "dxheaders.hpp"
|
2024-03-18 15:41:46 -03:00
|
|
|
|
|
|
|
namespace xna {
|
2024-03-21 16:01:47 -03:00
|
|
|
class SwapChain : public ISwapChain{
|
2024-03-18 15:41:46 -03:00
|
|
|
public:
|
2024-03-21 16:01:47 -03:00
|
|
|
virtual ~SwapChain() override {
|
2024-04-23 16:11:17 -03:00
|
|
|
if (dxSwapChain) {
|
|
|
|
dxSwapChain->Release();
|
|
|
|
dxSwapChain = nullptr;
|
2024-03-18 15:41:46 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-22 11:22:18 -03:00
|
|
|
virtual bool Initialize(GraphicsDevice& device, GameWindow const& gameWindow) override;
|
|
|
|
bool Initialize(GraphicsDevice& device, GameWindow const& gameWindow, DXGI_SWAP_CHAIN_DESC1 const& desc, DXGI_SWAP_CHAIN_FULLSCREEN_DESC const& fullScreenDesc);
|
2024-03-21 16:01:47 -03:00
|
|
|
|
2024-04-23 16:11:17 -03:00
|
|
|
bool GetBackBuffer(ID3D11Texture2D*& texture2D);
|
2024-03-18 15:41:46 -03:00
|
|
|
|
2024-04-23 16:11:17 -03:00
|
|
|
bool Present(bool vsync);
|
2024-03-18 15:41:46 -03:00
|
|
|
|
2024-03-21 16:01:47 -03:00
|
|
|
public:
|
2024-04-23 16:11:17 -03:00
|
|
|
IDXGISwapChain1* dxSwapChain{ nullptr };
|
|
|
|
DXGI_SWAP_CHAIN_DESC1 dxDescription{};
|
|
|
|
DXGI_SWAP_CHAIN_FULLSCREEN_DESC dxFullScreenDescription{};
|
2024-03-21 16:01:47 -03:00
|
|
|
};
|
2024-03-18 15:41:46 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|