rasterizer_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 RasterizerStateDescription_Impl;
40
42 class RasterizerStateDescription
43 {
46 public:
47 RasterizerStateDescription();
48 RasterizerStateDescription clone() const;
50
53 public:
54 bool get_culled() const;
55 bool get_enable_line_antialiasing() const;
56 CullMode get_face_cull_mode() const;
57 FillMode get_face_fill_mode() const;
58 FaceSide get_front_face() const;
59 bool get_enable_scissor() const;
60
61 bool get_antialiased() const;
62 bool get_offset_point() const;
63 bool get_offset_line() const;
64 bool get_offset_fill() const;
65 void get_polygon_offset(float &out_factor, float &out_units) const;
66 float get_point_size() const;
67 float get_point_fade_treshold_size() const;
68 bool is_point_size() const;
69 PointSpriteOrigin get_point_sprite_origin() const;
70
72
75 public:
77 void set_culled(bool value);
78
80
81 void enable_line_antialiasing(bool enabled);
82
84 void set_face_cull_mode(CullMode value);
85
87 void set_face_fill_mode(FillMode value);
88
90 void set_front_face(FaceSide value);
91
93 void enable_scissor(bool enabled);
94
96 void enable_antialiased(bool value);
97
99 void enable_offset_point(bool value);
100
102 void enable_offset_line(bool value);
103
105 void enable_offset_fill(bool value);
106
108 void set_polygon_offset(float factor, float units);
109
111 void set_point_size(float);
112
114 void set_point_fade_treshold_size(float);
115
117 void enable_point_size(bool enable);
118
120 void set_point_sprite_origin(PointSpriteOrigin origin);
121
122
124
125 bool operator==(const RasterizerStateDescription &other) const;
126 bool operator<(const RasterizerStateDescription &other) const;
127
130 private:
131 std::shared_ptr<RasterizerStateDescription_Impl> impl;
133 };
134
135 }
136
clan::RasterizerStateDescription::get_antialiased
bool get_antialiased() const
clan::PointSpriteOrigin
PointSpriteOrigin
Point Sprite Origin.
Definition: graphic_context.h:213
clan::RasterizerStateDescription
Rasterizer state description.
Definition: rasterizer_state_description.h:42
clan
Definition: clanapp.h:35
clan::RasterizerStateDescription::enable_offset_line
void enable_offset_line(bool value)
Enables/disables line offsetting.
clan::FaceSide
FaceSide
Front face modes.
Definition: graphic_context.h:85
clan::RasterizerStateDescription::get_enable_scissor
bool get_enable_scissor() const
clan::RasterizerStateDescription::get_polygon_offset
void get_polygon_offset(float &out_factor, float &out_units) const
clan::RasterizerStateDescription::enable_offset_fill
void enable_offset_fill(bool value)
Enables/disables polygon offsetting.
clan::RasterizerStateDescription::get_culled
bool get_culled() const
clan::RasterizerStateDescription::set_point_fade_treshold_size
void set_point_fade_treshold_size(float)
Alpha fade point once minimum size treshold reached. Requires multisampling to be enabled...
clan::RasterizerStateDescription::get_face_cull_mode
CullMode get_face_cull_mode() const
clan::RasterizerStateDescription::enable_point_size
void enable_point_size(bool enable)
Enables if points sizes is set by the vertex shader. (clanGL only)
clan::RasterizerStateDescription::set_front_face
void set_front_face(FaceSide value)
Sets which side is the front side of a face.
clan::RasterizerStateDescription::enable_antialiased
void enable_antialiased(bool value)
Enables/disables anti-aliasing. (clanGL only)
clan::CullMode
CullMode
Polygon culling modes.
Definition: graphic_context.h:69
clan::RasterizerStateDescription::get_offset_line
bool get_offset_line() const
clan::RasterizerStateDescription::operator<
bool operator<(const RasterizerStateDescription &other) const
clan::RasterizerStateDescription::get_enable_line_antialiasing
bool get_enable_line_antialiasing() const
clan::RasterizerStateDescription::get_point_size
float get_point_size() const
clan::RasterizerStateDescription::is_point_size
bool is_point_size() const
clan::RasterizerStateDescription::enable_offset_point
void enable_offset_point(bool value)
Enables/disables point offsetting.
clan::RasterizerStateDescription::set_culled
void set_culled(bool value)
Enables/disables polygon cull clipping.
clan::RasterizerStateDescription::set_face_cull_mode
void set_face_cull_mode(CullMode value)
Sets the polygon cull clipping mode.
clan::RasterizerStateDescription::operator==
bool operator==(const RasterizerStateDescription &other) const
clan::RasterizerStateDescription::enable_line_antialiasing
void enable_line_antialiasing(bool enabled)
Setting to true enables line antialiasing.
clan::RasterizerStateDescription::set_point_size
void set_point_size(float)
The default value is 1.0 (clanGL only)
clan::FillMode
FillMode
Polygon filling modes.
Definition: graphic_context.h:77
clan::RasterizerStateDescription::set_point_sprite_origin
void set_point_sprite_origin(PointSpriteOrigin origin)
Sets the origin of texture point sprites. (clanGL only)
clan::RasterizerStateDescription::get_front_face
FaceSide get_front_face() const
clan::RasterizerStateDescription::set_polygon_offset
void set_polygon_offset(float factor, float units)
Sets the offset factor.
clan::RasterizerStateDescription::get_face_fill_mode
FillMode get_face_fill_mode() const
clan::RasterizerStateDescription::enable_scissor
void enable_scissor(bool enabled)
Enables/disables if clipping rects are used.
clan::RasterizerStateDescription::set_face_fill_mode
void set_face_fill_mode(FillMode value)
Sets the filling mode for polygons.
clan::RasterizerStateDescription::get_offset_point
bool get_offset_point() const
clan::RasterizerStateDescription::get_offset_fill
bool get_offset_fill() const
clan::RasterizerStateDescription::get_point_sprite_origin
PointSpriteOrigin get_point_sprite_origin() const
clan::RasterizerStateDescription::RasterizerStateDescription
RasterizerStateDescription()
clan::RasterizerStateDescription::get_point_fade_treshold_size
float get_point_fade_treshold_size() const
clan::RasterizerStateDescription::clone
RasterizerStateDescription clone() const