1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/framework/platform/swapchain-dx.hpp

35 lines
941 B
C++
Raw Normal View History

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-04-25 14:51:33 -03:00
#include "../graphics/gresource.hpp"
2024-03-18 15:41:46 -03:00
namespace xna {
2024-04-25 14:51:33 -03:00
class SwapChain : public ISwapChain, public GraphicsResource {
2024-03-18 15:41:46 -03:00
public:
2024-04-25 14:51:33 -03:00
SwapChain(GraphicsDevice* device): GraphicsResource(device){}
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
}
}
virtual bool Initialize(xna_error_nullarg) override;
2024-04-25 14:51:33 -03:00
bool Initialize(GameWindow const& gameWindow, DXGI_SWAP_CHAIN_DESC1 const& desc, DXGI_SWAP_CHAIN_FULLSCREEN_DESC const& fullScreenDesc, xna_error_nullarg);
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