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

99 lines
5.5 KiB
C++
Raw Normal View History

2024-04-15 09:48:16 -03:00
#ifndef XNA_GRAPHICS_DEPTHSTENCILSTATE_HPP
#define XNA_GRAPHICS_DEPTHSTENCILSTATE_HPP
#include "../default.hpp"
2024-05-20 10:29:20 -03:00
#include "gresource.hpp"
2024-04-15 09:48:16 -03:00
namespace xna {
2024-06-23 23:14:06 -03:00
//Contains depth-stencil state for the device.
2024-05-20 10:29:20 -03:00
class DepthStencilState : public GraphicsResource {
2024-04-15 09:48:16 -03:00
public:
2024-05-20 10:29:20 -03:00
DepthStencilState();
DepthStencilState(sptr<GraphicsDevice> const& device);
2024-04-15 09:48:16 -03:00
2024-06-23 23:14:06 -03:00
//Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle.
//The default is StencilOperation.Keep.
void CounterClockwiseStencilDepthBufferFail(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil test passes and the depth-buffer test fails for a counterclockwise triangle.
//The default is StencilOperation.Keep.
StencilOperation CounterClockwiseStencilDepthBufferFail() const;
//Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle.
//The default is StencilOperation.Keep.
void CounterClockwiseStencilFail(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil test fails for a counterclockwise triangle.
//The default is StencilOperation.Keep.
StencilOperation CounterClockwiseStencilFail() const;
//Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.
void CounterClockwiseStencilFunction(CompareFunction value);
//Gets or sets the comparison function to use for counterclockwise stencil tests. The default is CompareFunction.Always.
CompareFunction CounterClockwiseStencilFunction() const;
//Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle.
//The default is StencilOperation.Keep.
void CounterClockwiseStencilPass(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil and depth-tests pass for a counterclockwise triangle.
//The default is StencilOperation.Keep.
StencilOperation CounterClockwiseStencilPass() const;
//Enables or disables depth buffering. The default is true.
void DepthBufferEnable(bool value);
//Enables or disables depth buffering. The default is true.
bool DepthBufferEnable() const;
//Enables or disables writing to the depth buffer. The default is true.
void DepthBufferWriteEnable(bool value);
//Enables or disables writing to the depth buffer. The default is true.
bool DepthBufferWriteEnable() const;
//Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual
void DepthBufferFunction(CompareFunction value);
//Gets or sets the comparison function for the depth-buffer test. The default is CompareFunction.LessEqual
CompareFunction DepthBufferFunction() const;
//Gets or sets stencil enabling. The default is false.
void StencilEnable(bool value);
//Gets or sets stencil enabling. The default is false.
bool StencilEnable() const;
//Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.
void StencilFail(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil test fails. The default is StencilOperation.Keep.
StencilOperation StencilFail() const;
//Gets or sets the comparison function for the stencil test.The default is CompareFunction.Always.
void StencilFunction(CompareFunction value);
//Gets or sets the comparison function for the stencil test. The default is CompareFunction.Always.
CompareFunction StencilFunction() const;
//Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test.
//The default mask is Int32.MaxValue.
void StencilMask(Int value);
//Gets or sets the mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test.
//The default mask is Int32.MaxValue.
Int StencilMask() const;
//Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.
2024-05-20 10:29:20 -03:00
void StencilWriteMask(Int value);
2024-06-23 23:14:06 -03:00
//Gets or sets the write mask applied to values written into the stencil buffer. The default mask is Int32.MaxValue.
2024-05-20 10:29:20 -03:00
Int StencilWriteMask() const;
2024-06-23 23:14:06 -03:00
//Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.
void StencilPass(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil test passes. The default is StencilOperation.Keep.
StencilOperation StencilPass() const;
//Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is StencilOperation.Keep.
void StencilDepthBufferFail(StencilOperation value);
//Gets or sets the stencil operation to perform if the stencil test passes and the depth-test fails. The default is StencilOperation.Keep.
StencilOperation StencilDepthBufferFail() const;
2024-05-20 10:29:20 -03:00
2024-06-23 23:14:06 -03:00
//A built-in state object with settings for not using a depth stencil buffer.
2024-05-20 10:29:20 -03:00
static uptr<DepthStencilState> None();
2024-06-23 23:14:06 -03:00
//A built-in state object with default settings for using a depth stencil buffer.
2024-05-20 10:29:20 -03:00
static uptr<DepthStencilState> Default();
2024-06-23 23:14:06 -03:00
//A built-in state object with settings for enabling a read-only depth stencil buffer.
2024-05-20 10:29:20 -03:00
static uptr<DepthStencilState> DepthRead();
2024-06-23 23:14:06 -03:00
bool Initialize();
bool Apply();
2024-05-20 10:29:20 -03:00
public:
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;
2024-04-15 09:48:16 -03:00
};
2024-06-24 15:11:07 -03:00
using PDepthStencilState = sptr<DepthStencilState>;
2024-04-15 09:48:16 -03:00
}
#endif