📄 wg__painter_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>wg_painter.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> </center><hr><h1>wg_painter.h</h1><div class="fragment"><pre>00001 <span class="comment">// wg_painter.h</span>00002 <span class="comment">//</span>00003 <span class="comment">// CPainter class which provides useful graphics routines</span>00004 <span class="comment">//</span>00005 <span class="comment">//</span>00006 <span class="comment">// Copyright (c) 2002 Rob Wiskow</span>00007 <span class="comment">// rob-dev@boxedchaos.com</span>00008 <span class="comment">//</span>00009 <span class="comment">// This library is free software; you can redistribute it and/or</span>00010 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>00011 <span class="comment">// License as published by the Free Software Foundation; either</span>00012 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>00013 <span class="comment">//</span>00014 <span class="comment">// This library is distributed in the hope that it will be useful,</span>00015 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>00016 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>00017 <span class="comment">// Lesser General Public License for more details.</span>00018 <span class="comment">//</span>00019 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>00020 <span class="comment">// License along with this library; if not, write to the Free Software</span>00021 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>00022 <span class="comment">//</span>00023 00024 00025 <span class="preprocessor">#ifndef _WG_GRAPHICS_H_</span>00026 <span class="preprocessor"></span><span class="preprocessor">#define _WG_GRAPHICS_H_</span>00027 <span class="preprocessor"></span>00028 <span class="preprocessor">#include "wg_rect.h"</span>00029 <span class="preprocessor">#include "wg_color.h"</span>00030 <span class="preprocessor">#include "wg_point.h"</span>00031 <span class="preprocessor">#include "wg_window.h"</span>00032 <span class="preprocessor">#include "SDL.h"</span>00033 00034 00035 <span class="keyword">namespace </span>wGui00036 {00037 00039 <a name="l00040"></a><a class="code" href="classwGui_1_1CPainter.html">00040</a> <span class="keyword">class </span><a class="code" href="classwGui_1_1CPainter.html">CPainter</a>00041 {00042 <span class="keyword">public</span>:<a name="l00045"></a><a class="code" href="classwGui_1_1CPainter.html#s6">00045</a> <span class="keyword">enum</span> <a class="code" href="classwGui_1_1CPainter.html#s6">EPaintMode</a> {00046 <a class="code" href="classwGui_1_1CPainter.html#s6s0">PAINT_IGNORE</a> = 0, 00047 <a class="code" href="classwGui_1_1CPainter.html#s6s1">PAINT_REPLACE</a>, 00048 <a class="code" href="classwGui_1_1CPainter.html#s6s2">PAINT_NORMAL</a>, 00049 <a class="code" href="classwGui_1_1CPainter.html#s6s3">PAINT_OR</a>, 00050 <a class="code" href="classwGui_1_1CPainter.html#s6s4">PAINT_AND</a>, 00051 <a class="code" href="classwGui_1_1CPainter.html#s6s5">PAINT_XOR</a> 00052 };00053 00057 <a class="code" href="classwGui_1_1CPainter.html#a0">CPainter</a>(SDL_Surface* pSurface, <a class="code" href="classwGui_1_1CPainter.html#s6">EPaintMode</a> ePaintMode = <a class="code" href="classwGui_1_1CPainter.html#s6s2">PAINT_NORMAL</a>);00058 00062 <a class="code" href="classwGui_1_1CPainter.html#a0">CPainter</a>(CWindow* pWindow, <a class="code" href="classwGui_1_1CPainter.html#s6">EPaintMode</a> ePaintMode = <a class="code" href="classwGui_1_1CPainter.html#s6s2">PAINT_NORMAL</a>);00063 <a name="l00065"></a><a class="code" href="classwGui_1_1CPainter.html#a2">00065</a> <span class="keyword">virtual</span> <a class="code" href="classwGui_1_1CPainter.html#a2">~CPainter</a>(<span class="keywordtype">void</span>) { }00066 00067 00073 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a3">DrawHLine</a>(<span class="keywordtype">int</span> xStart, <span class="keywordtype">int</span> xEnd, <span class="keywordtype">int</span> y, <span class="keyword">const</span> CRGBColor& LineColor = DEFAULT_LINE_COLOR);00074 00080 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a4">DrawVLine</a>(<span class="keywordtype">int</span> yStart, <span class="keywordtype">int</span> yEnd, <span class="keywordtype">int</span> x, <span class="keyword">const</span> CRGBColor& LineColor = DEFAULT_LINE_COLOR);00081 00087 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a5">DrawRect</a>(<span class="keyword">const</span> CRect& Rect, <span class="keywordtype">bool</span> bFilled, <span class="keyword">const</span> CRGBColor& BorderColor = DEFAULT_LINE_COLOR,00088 <span class="keyword">const</span> CRGBColor& FillColor = DEFAULT_FG_COLOR);00089 00094 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a6">DrawLine</a>(<span class="keyword">const</span> CPoint& StartPoint, <span class="keyword">const</span> CPoint& EndPoint, <span class="keyword">const</span> CRGBColor& LineColor = DEFAULT_LINE_COLOR);00095 00099 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a7">DrawPoint</a>(<span class="keyword">const</span> CPoint& Point, <span class="keyword">const</span> CRGBColor& PointColor = DEFAULT_LINE_COLOR);00100 00104 CRGBColor <a class="code" href="classwGui_1_1CPainter.html#a8">ReadPoint</a>(<span class="keyword">const</span> CPoint& Point);00105 00109 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a9">ReplaceColor</a>(<span class="keyword">const</span> CRGBColor& NewColor, <span class="keyword">const</span> CRGBColor& OldColor);00110 00113 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#a10">TransparentColor</a>(<span class="keyword">const</span> CRGBColor& <a class="code" href="classwGui_1_1CPainter.html#a10">TransparentColor</a>);00114 00115 00116 <span class="keyword">protected</span>:00118 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#b0">LockSurface</a>(<span class="keywordtype">void</span>);00119 00121 <span class="keywordtype">void</span> <a class="code" href="classwGui_1_1CPainter.html#b1">UnlockSurface</a>(<span class="keywordtype">void</span>);00122 00127 CRGBColor <a class="code" href="classwGui_1_1CPainter.html#b2">MixColor</a>(<span class="keyword">const</span> CRGBColor& ColorBase, <span class="keyword">const</span> CRGBColor& ColorAdd);00128 <a name="l00129"></a><a class="code" href="classwGui_1_1CPainter.html#n0">00129</a> SDL_Surface* <a class="code" href="classwGui_1_1CPainter.html#n0">m_pSurface</a>; <a name="l00130"></a><a class="code" href="classwGui_1_1CPainter.html#n1">00130</a> <a class="code" href="classwGui_1_1CWindow.html">CWindow</a>* <a class="code" href="classwGui_1_1CPainter.html#n1">m_pWindow</a>; <a name="l00131"></a><a class="code" href="classwGui_1_1CPainter.html#n2">00131</a> <a class="code" href="classwGui_1_1CPainter.html#s6">EPaintMode</a> <a class="code" href="classwGui_1_1CPainter.html#n2">m_PaintMode</a>; 00132 };00133 00134 00135 }00136 00137 <span class="preprocessor">#endif // _WG_GRAPHICS_H_</span>00138 <span class="preprocessor"></span></pre></div><hr><address style="align: right;"><small>Generated on Sat Oct 25 12:43:24 2003 for wGui by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -