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

Correções em GraphicsDevice

This commit is contained in:
Danilo 2024-06-05 21:09:35 -03:00
parent 4335323879
commit 126a424a24
4 changed files with 19 additions and 9 deletions

View File

@ -178,13 +178,7 @@ namespace xna {
if (!impl) return nullptr;
return impl->_adapter;
}
void GraphicsDevice::Adapter(sptr<GraphicsAdapter> const& adapter) {
if (!impl) return;
impl->_adapter = adapter;
}
}
xna::Viewport GraphicsDevice::Viewport() const {
if (!impl) return {};
@ -202,5 +196,5 @@ namespace xna {
if (!impl) return;
impl->_usevsync = use;
}
}
}

View File

@ -450,6 +450,14 @@ namespace xna {
Immediate
};
enum class PrimitiveType
{
TriangleList,
TriangleStrip,
LineList,
LineStrip,
};
enum RenderTargetUsage {
DiscardContents,
PreserveContents,

View File

@ -14,11 +14,12 @@ namespace xna {
bool Initialize();
bool Present();
sptr<GraphicsAdapter> Adapter() const;
void Adapter(sptr<GraphicsAdapter> const& adapter);
xna::Viewport Viewport() const;
void Viewport(xna::Viewport const& viewport);
void UseVSync(bool use);
//void DrawPrimitives(PrimitiveType primitiveType, Int startVertex, Int primitiveCount);
public:
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;

View File

@ -246,6 +246,13 @@ namespace xna {
};
struct SwapChain::PlatformImplementation {
~PlatformImplementation() {
if (dxSwapChain) {
dxSwapChain->Release();
dxSwapChain = nullptr;
}
}
IDXGISwapChain1* dxSwapChain{ nullptr };
DXGI_SWAP_CHAIN_DESC1 dxDescription{};
DXGI_SWAP_CHAIN_FULLSCREEN_DESC dxFullScreenDescription{};