draw.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 **    Kenneth Gangstoe
00027 **    Harry Storbacka
00028 **    Ken Hirsch
00029 */
00030 
00033 
00034 #pragma once
00035 
00036 #ifdef _MSC_VER
00037 #pragma warning( disable : 4786)
00038 #endif
00039 
00040 #include "../api_display.h"
00041 #include "../Render/graphic_context.h"
00042 
00043 class CL_Colorf;
00044 class CL_Pointf;
00045 class CL_Gradient;
00046 class CL_LineSegment2f;
00047 class CL_LineSegment2;
00048 class CL_Quadf;
00049 class CL_Trianglef;
00050 class CL_Triangle;
00051 
00055 class CL_API_DISPLAY CL_Draw
00056 {
00059 
00060 public:
00062         static void point(CL_GraphicContext &gc, float x1, float y1, const CL_Colorf &color);
00063 
00069         static void point(CL_GraphicContext &gc, const CL_Pointf &point, const CL_Colorf &color);
00070 
00072         static void line(CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color);
00073 
00080         static void line(CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color);
00081 
00087         static void line(CL_GraphicContext &gc, const CL_LineSegment2f &line_segment, const CL_Colorf &color);
00088 
00090         static void box(CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color);
00091 
00098         static void box(CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color);
00099 
00105         static void box(CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color);
00106 
00108         static void fill(CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Colorf &color);
00109 
00116         static void fill(CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Colorf &color);
00117 
00123         static void fill(CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Colorf &color);
00124 
00129         static void texture(
00130                 CL_GraphicContext &gc,
00131                 const CL_Rectf &rect,
00132                 const CL_Colorf &color = CL_Colorf::white,
00133                 const CL_Rectf &texture_unit1_coords = CL_Rectf(0.0, 0.0, 1.0, 1.0));
00134 
00138         static void texture(
00139                 CL_GraphicContext &gc,
00140                 const CL_Texture &texture,
00141                 const CL_Quadf &quad,
00142                 const CL_Colorf &color = CL_Colorf::white,
00143                 const CL_Rectf &texture_unit1_coords = CL_Rectf(0.0, 0.0, 1.0, 1.0));
00144 
00153         static void gradient_fill(CL_GraphicContext &gc, float x1, float y1, float x2, float y2, const CL_Gradient &color);
00154 
00161         static void gradient_fill(CL_GraphicContext &gc, const CL_Pointf &start, const CL_Pointf &end, const CL_Gradient &gradient);
00162 
00168         static void gradient_fill(CL_GraphicContext &gc, const CL_Rectf &rect, const CL_Gradient &gradient);
00169 
00171         static void circle(CL_GraphicContext &gc, float center_x, float center_y, float radius, const CL_Colorf &color);
00172 
00179         static void circle(CL_GraphicContext &gc, const CL_Pointf &center, float radius, const CL_Colorf &color);
00180 
00187         static void gradient_circle(CL_GraphicContext &gc, const CL_Pointf &center, float radius, const CL_Gradient &gradient);
00188 
00196         static void gradient_circle(CL_GraphicContext &gc, const CL_Pointf &center, const CL_Pointf &centergradient, float radius, const CL_Gradient &gradient);
00197 
00199         static void triangle(CL_GraphicContext &gc, const CL_Pointf &a, const CL_Pointf &b, const CL_Pointf &c, const CL_Colorf &color);
00200 
00202         static void triangle(CL_GraphicContext &gc, const CL_Trianglef &dest_triangle, const CL_Colorf &color);
00203 
00205 };
00206