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:
parent
4335323879
commit
126a424a24
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -450,6 +450,14 @@ namespace xna {
|
||||
Immediate
|
||||
};
|
||||
|
||||
enum class PrimitiveType
|
||||
{
|
||||
TriangleList,
|
||||
TriangleStrip,
|
||||
LineList,
|
||||
LineStrip,
|
||||
};
|
||||
|
||||
enum RenderTargetUsage {
|
||||
DiscardContents,
|
||||
PreserveContents,
|
||||
|
@ -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;
|
||||
|
@ -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{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user