depth_stencil_state_description.h Source File - ClanLib SDK
Description: depth_stencil_state_description.h Source File

depth_stencil_state_description.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27*/
28
29#pragma once
30
31#include "graphic_context.h"
32
33namespace clan
34{
37
38 class DepthStencilStateDescription_Impl;
39
41 class DepthStencilStateDescription
42 {
43 public:
44 DepthStencilStateDescription();
45 DepthStencilStateDescription clone() const;
46
47 bool is_stencil_test_enabled() const;
48 void get_stencil_compare_front(CompareFunction &out_front, int &out_front_ref, int &out_front_mask) const;
49 void get_stencil_compare_back(CompareFunction &out_back, int &out_back_ref, int &out_back_mask) const;
50 void get_stencil_write_mask(unsigned char &out_front_facing_mask, unsigned char &out_back_facing_mask) const;
51 void get_stencil_op_front(StencilOp &out_fail_front, StencilOp &out_pass_depth_fail_front, StencilOp &out_pass_depth_pass_front) const;
52 void get_stencil_op_back(StencilOp &out_fail_back, StencilOp &out_pass_depth_fail_back, StencilOp &out_pass_depth_pass_back) const;
53
54 bool is_depth_test_enabled() const;
55 bool is_depth_write_enabled() const;
56 CompareFunction get_depth_compare_function() const;
57
59 void enable_stencil_test(bool enabled);
60
62 void set_stencil_compare_front(CompareFunction front, int front_ref, int front_mask);
63
65 void set_stencil_compare_back(CompareFunction back, int back_ref, int back_mask);
66
68 void set_stencil_write_mask(unsigned char front_facing_mask, unsigned char back_facing_mask);
69
75 void set_stencil_op_front(StencilOp fail_front, StencilOp pass_depth_fail_front, StencilOp pass_depth_pass_front);
76
82 void set_stencil_op_back(StencilOp fail_back, StencilOp pass_depth_fail_back, StencilOp pass_depth_pass_back);
83
85 void enable_depth_test(bool enabled);
86
88 void enable_depth_write(bool enabled);
89
91 void set_depth_compare_function(CompareFunction func);
92
93 bool operator==(const DepthStencilStateDescription &other) const;
94 bool operator<(const DepthStencilStateDescription &other) const;
95
96 private:
97 std::shared_ptr<DepthStencilStateDescription_Impl> impl;
98 };
99
101}
clan::DepthStencilStateDescription
DepthStencil state description.
Definition depth_stencil_state_description.h:42
clan::DepthStencilStateDescription::clone
DepthStencilStateDescription clone() const
clan::DepthStencilStateDescription::get_stencil_op_back
void get_stencil_op_back(StencilOp &out_fail_back, StencilOp &out_pass_depth_fail_back, StencilOp &out_pass_depth_pass_back) const
clan::DepthStencilStateDescription::get_stencil_op_front
void get_stencil_op_front(StencilOp &out_fail_front, StencilOp &out_pass_depth_fail_front, StencilOp &out_pass_depth_pass_front) const
clan::DepthStencilStateDescription::set_depth_compare_function
void set_depth_compare_function(CompareFunction func)
Set depth test function.
clan::DepthStencilStateDescription::get_stencil_compare_front
void get_stencil_compare_front(CompareFunction &out_front, int &out_front_ref, int &out_front_mask) const
clan::DepthStencilStateDescription::is_stencil_test_enabled
bool is_stencil_test_enabled() const
clan::DepthStencilStateDescription::enable_stencil_test
void enable_stencil_test(bool enabled)
Enables/disables stencil testing.
clan::DepthStencilStateDescription::is_depth_test_enabled
bool is_depth_test_enabled() const
clan::DepthStencilStateDescription::set_stencil_compare_front
void set_stencil_compare_front(CompareFunction front, int front_ref, int front_mask)
Set stencil compare function.
clan::DepthStencilStateDescription::set_stencil_op_front
void set_stencil_op_front(StencilOp fail_front, StencilOp pass_depth_fail_front, StencilOp pass_depth_pass_front)
Set stencil operations.
clan::DepthStencilStateDescription::enable_depth_test
void enable_depth_test(bool enabled)
Enables/disables depth testing.
clan::DepthStencilStateDescription::DepthStencilStateDescription
DepthStencilStateDescription()
clan::DepthStencilStateDescription::operator==
bool operator==(const DepthStencilStateDescription &other) const
clan::DepthStencilStateDescription::set_stencil_write_mask
void set_stencil_write_mask(unsigned char front_facing_mask, unsigned char back_facing_mask)
Set stencil write masks.
clan::DepthStencilStateDescription::set_stencil_compare_back
void set_stencil_compare_back(CompareFunction back, int back_ref, int back_mask)
Set stencil compare function.
clan::DepthStencilStateDescription::operator<
bool operator<(const DepthStencilStateDescription &other) const
clan::DepthStencilStateDescription::get_stencil_write_mask
void get_stencil_write_mask(unsigned char &out_front_facing_mask, unsigned char &out_back_facing_mask) const
clan::DepthStencilStateDescription::is_depth_write_enabled
bool is_depth_write_enabled() const
clan::DepthStencilStateDescription::get_depth_compare_function
CompareFunction get_depth_compare_function() const
clan::DepthStencilStateDescription::get_stencil_compare_back
void get_stencil_compare_back(CompareFunction &out_back, int &out_back_ref, int &out_back_mask) const
clan::DepthStencilStateDescription::enable_depth_write
void enable_depth_write(bool enabled)
Enables/disables depth writing.
clan::DepthStencilStateDescription::set_stencil_op_back
void set_stencil_op_back(StencilOp fail_back, StencilOp pass_depth_fail_back, StencilOp pass_depth_pass_back)
Set stencil operations.
clan::CompareFunction
CompareFunction
Compare functions.
Definition graphic_context.h:92
clan::StencilOp
StencilOp
Stencil operations.
Definition graphic_context.h:105
clan::CullMode::back
@ back
clan::CullMode::front
@ front
clan
Definition clanapp.h:36