2024-03-18 15:41:46 -03:00
|
|
|
#ifndef XNA_GRAPHICS_DEVICE_HPP
|
|
|
|
#define XNA_GRAPHICS_DEVICE_HPP
|
|
|
|
|
2024-05-24 22:26:10 -03:00
|
|
|
#include "../default.hpp"
|
2024-03-18 15:41:46 -03:00
|
|
|
|
|
|
|
namespace xna {
|
2024-06-24 15:11:07 -03:00
|
|
|
//Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders.
|
2024-05-24 22:26:10 -03:00
|
|
|
class GraphicsDevice : public std::enable_shared_from_this<GraphicsDevice> {
|
2024-03-18 15:41:46 -03:00
|
|
|
public:
|
2024-05-24 22:26:10 -03:00
|
|
|
GraphicsDevice();
|
|
|
|
GraphicsDevice(GraphicsDeviceInformation const& info);
|
2024-06-24 15:11:07 -03:00
|
|
|
|
|
|
|
//Gets the graphics adapter.
|
|
|
|
sptr<GraphicsAdapter> Adapter() const;
|
|
|
|
|
|
|
|
//Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
|
|
|
|
sptr<xna::BlendState> BlendState() const;
|
|
|
|
//Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque.
|
|
|
|
void BlendState(sptr<xna::BlendState> const& value);
|
|
|
|
//Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
|
|
|
|
sptr<xna::DepthStencilState> DepthStencilState() const;
|
|
|
|
//Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default.
|
|
|
|
void DepthStencilState(sptr<xna::DepthStencilState> const& value);
|
|
|
|
//Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
|
|
|
|
sptr<xna::RasterizerState> RasterizerState() const;
|
|
|
|
//Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise.
|
|
|
|
void RasterizerState(sptr<xna::RasterizerState> const& value);
|
|
|
|
//Retrieves a collection of SamplerState objects for the current GraphicsDevice.
|
|
|
|
sptr<SamplerStateCollection> SamplerStates() const;
|
|
|
|
|
|
|
|
//Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
|
|
|
|
Int MultiSampleMask() const;
|
|
|
|
//Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff).
|
|
|
|
void MultiSampleMask(Int value);
|
2024-06-25 15:41:11 -03:00
|
|
|
|
2024-05-24 22:26:10 -03:00
|
|
|
void Clear(Color const& color);
|
2024-06-25 15:41:11 -03:00
|
|
|
void Clear(ClearOptions options, Color const& color, float depth, Int stencil);
|
|
|
|
void Clear(ClearOptions options, Vector4 const& color, float depth, Int stencil);
|
2024-06-05 09:26:33 -03:00
|
|
|
bool Initialize();
|
2024-05-24 22:26:10 -03:00
|
|
|
bool Present();
|
2024-06-24 15:11:07 -03:00
|
|
|
|
2024-05-24 22:26:10 -03:00
|
|
|
xna::Viewport Viewport() const;
|
|
|
|
void Viewport(xna::Viewport const& viewport);
|
|
|
|
void UseVSync(bool use);
|
|
|
|
|
2024-06-05 21:09:35 -03:00
|
|
|
//void DrawPrimitives(PrimitiveType primitiveType, Int startVertex, Int primitiveCount);
|
|
|
|
|
2024-05-24 22:26:10 -03:00
|
|
|
public:
|
|
|
|
struct PlatformImplementation;
|
|
|
|
uptr<PlatformImplementation> impl = nullptr;
|
2024-03-18 15:41:46 -03:00
|
|
|
};
|
2024-06-09 20:18:13 -03:00
|
|
|
|
|
|
|
using PGraphicsDevice = sptr<GraphicsDevice>;
|
2024-03-18 15:41:46 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|