polygon_rasterizer.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Harry Storbacka
00027 */
00028 
00031 
00032 #pragma once
00033 
00034 #include "../api_display.h"
00035 #include "../../Core/System/sharedptr.h"
00036 #include "../Image/pixel_buffer.h"
00037 
00038 class CL_PolygonRasterizer_Impl;
00039 
00043 enum CL_CullMode
00044 {
00045         cl_cull_front,
00046         cl_cull_back,
00047         cl_cull_front_and_back
00048 };
00049 
00053 enum CL_FillMode
00054 {
00055         cl_fill_point,
00056         cl_fill_line,
00057         cl_fill_polygon
00058 };
00059 
00063 enum CL_FaceSide
00064 {
00065         cl_face_side_clockwise,
00066         cl_face_side_counter_clockwise
00067 };
00068 
00072 class CL_API_DISPLAY CL_PolygonRasterizer
00073 {
00076 
00077 public:
00079         CL_PolygonRasterizer();
00080 
00081         virtual ~CL_PolygonRasterizer();
00082 
00086 
00087 public:
00089         bool is_antialiased() const;
00090 
00092         bool is_culled() const;
00093 
00095         bool is_point_offset() const;
00096 
00098         bool is_line_offset() const;
00099 
00101         bool is_polygon_offset() const;
00102 
00104         CL_CullMode get_face_cull_mode() const;
00105 
00107         CL_FillMode get_face_fill_mode() const;
00108         
00110         float get_offset_factor() const;
00111 
00113         float get_offset_units() const;
00114 
00116         CL_FaceSide get_front_face() const;
00117 
00121 
00122 public:
00124         void set_antialiased(bool value);
00125 
00127         void set_culled(bool value);
00128 
00130         void set_point_offset(bool value);
00131 
00133         void set_line_offset(bool value);
00134 
00136         void set_polygon_offset(bool value);
00137 
00139         void set_face_cull_mode(CL_CullMode value);
00140 
00142         void set_face_fill_mode(CL_FillMode value);
00143         
00145         void set_front_face(CL_FaceSide value);
00146 
00148         void set_offset_factor(float value);
00149 
00151         void set_offset_units(float value);
00152 
00156 
00157 private:
00158         CL_SharedPtr<CL_PolygonRasterizer_Impl> impl;
00160 };
00161