depth_stencil_state_description.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 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 
30 #pragma once
31 
32 #include "graphic_context.h"
33 
34 namespace clan
35 {
38 
39 class DepthStencilStateDescription_Impl;
40 
43 {
46 public:
50 
53 public:
55  void get_stencil_compare_front(CompareFunction &out_front, int &out_front_ref, int &out_front_mask) const;
56  void get_stencil_compare_back(CompareFunction &out_back, int &out_back_ref, int &out_back_mask) const;
57  void get_stencil_write_mask(unsigned char &out_front_facing_mask, unsigned char &out_back_facing_mask) const;
58  void get_stencil_op_front(StencilOp &out_fail_front, StencilOp &out_pass_depth_fail_front, StencilOp &out_pass_depth_pass_front) const;
59  void get_stencil_op_back(StencilOp &out_fail_back, StencilOp &out_pass_depth_fail_back, StencilOp &out_pass_depth_pass_back) const;
60 
61  bool is_depth_test_enabled() const;
62  bool is_depth_write_enabled() const;
65 
68 public:
70  void enable_stencil_test(bool enabled);
71 
73  void set_stencil_compare_front(CompareFunction front, int front_ref, int front_mask);
74 
76  void set_stencil_compare_back(CompareFunction back, int back_ref, int back_mask);
77 
79  void set_stencil_write_mask(unsigned char front_facing_mask, unsigned char back_facing_mask);
80 
86  void set_stencil_op_front(StencilOp fail_front, StencilOp pass_depth_fail_front, StencilOp pass_depth_pass_front);
87 
93  void set_stencil_op_back(StencilOp fail_back, StencilOp pass_depth_fail_back, StencilOp pass_depth_pass_back);
94 
96  void enable_depth_test(bool enabled);
97 
99  void enable_depth_write(bool enabled);
100 
104 
105  bool operator==(const DepthStencilStateDescription &other) const;
106  bool operator<(const DepthStencilStateDescription &other) const;
107 
110 private:
111  std::shared_ptr<DepthStencilStateDescription_Impl> impl;
113 };
114 
115 }
116 
DepthStencil state description.
Definition: depth_stencil_state_description.h:43
void set_stencil_op_back(StencilOp fail_back, StencilOp pass_depth_fail_back, StencilOp pass_depth_pass_back)
Set stencil operations.
void get_stencil_compare_back(CompareFunction &out_back, int &out_back_ref, int &out_back_mask) const
void enable_depth_write(bool enabled)
Enables/disables depth writing.
void set_stencil_compare_front(CompareFunction front, int front_ref, int front_mask)
Set stencil compare function.
void set_depth_compare_function(CompareFunction func)
Set depth test function.
StencilOp
Stencil operations.
Definition: graphic_context.h:106
void get_stencil_compare_front(CompareFunction &out_front, int &out_front_ref, int &out_front_mask) const
void set_stencil_compare_back(CompareFunction back, int back_ref, int back_mask)
Set stencil compare function.
void get_stencil_write_mask(unsigned char &out_front_facing_mask, unsigned char &out_back_facing_mask) const
Definition: clanapp.h:36
void get_stencil_op_front(StencilOp &out_fail_front, StencilOp &out_pass_depth_fail_front, StencilOp &out_pass_depth_pass_front) const
bool operator==(const DepthStencilStateDescription &other) const
void enable_depth_test(bool enabled)
Enables/disables depth testing.
void enable_stencil_test(bool enabled)
Enables/disables stencil testing.
void set_stencil_write_mask(unsigned char front_facing_mask, unsigned char back_facing_mask)
Set stencil write masks.
void get_stencil_op_back(StencilOp &out_fail_back, StencilOp &out_pass_depth_fail_back, StencilOp &out_pass_depth_pass_back) const
CompareFunction
Compare functions.
Definition: graphic_context.h:93
DepthStencilStateDescription clone() const
bool operator<(const DepthStencilStateDescription &other) const
void set_stencil_op_front(StencilOp fail_front, StencilOp pass_depth_fail_front, StencilOp pass_depth_pass_front)
Set stencil operations.
CompareFunction get_depth_compare_function() const