rasterizer_state_description.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 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 "../api_display.h"
33 #include "graphic_context.h"
34 
35 namespace clan
36 {
39 
40 class RasterizerStateDescription_Impl;
41 
43 class CL_API_DISPLAY RasterizerStateDescription
44 {
47 public:
49  RasterizerStateDescription clone() const;
51 
54 public:
55  bool get_culled() const;
56  bool get_enable_line_antialiasing() const;
57  CullMode get_face_cull_mode() const;
58  FillMode get_face_fill_mode() const;
59  FaceSide get_front_face() const;
60  bool get_enable_scissor() const;
61 
62  bool get_antialiased() const;
63  bool get_offset_point() const;
64  bool get_offset_line() const;
65  bool get_offset_fill() const;
66  void get_polygon_offset(float &out_factor, float &out_units) const;
67  float get_point_size() const;
68  float get_point_fade_treshold_size() const;
69  bool is_point_size() const;
70  PointSpriteOrigin get_point_sprite_origin() const;
71 
73 
76 public:
78  void set_culled(bool value);
79 
81 
82  void enable_line_antialiasing(bool enabled);
83 
85  void set_face_cull_mode(CullMode value);
86 
88  void set_face_fill_mode(FillMode value);
89 
91  void set_front_face(FaceSide value);
92 
94  void enable_scissor(bool enabled);
95 
97  void enable_antialiased(bool value);
98 
100  void enable_offset_point(bool value);
101 
103  void enable_offset_line(bool value);
104 
106  void enable_offset_fill(bool value);
107 
109  void set_polygon_offset(float factor, float units);
110 
112  void set_point_size(float);
113 
115  void set_point_fade_treshold_size(float);
116 
118  void enable_point_size(bool enable);
119 
121  void set_point_sprite_origin(PointSpriteOrigin origin);
122 
123 
125 
126  bool operator==(const RasterizerStateDescription &other) const;
127  bool operator<(const RasterizerStateDescription &other) const;
128 
131 private:
132  std::shared_ptr<RasterizerStateDescription_Impl> impl;
134 };
135 
136 }
137 
PointSpriteOrigin
Point Sprite Origin.
Definition: graphic_context.h:214
Rasterizer state description.
Definition: rasterizer_state_description.h:43
FaceSide
Front face modes.
Definition: graphic_context.h:86
CullMode
Polygon culling modes.
Definition: graphic_context.h:70
FillMode
Polygon filling modes.
Definition: graphic_context.h:78