SoftRenderSurface.h

Go to the documentation of this file.
00001 /*
00002 SoftRenderSurface.h : SoftRenderSurface Implementation header
00003 
00004 Copyright (C) 2002-2004 The Pentagram Team
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with this program; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 */
00020 
00021 #ifndef SOFTRENDERSURFACE_H
00022 #define SOFTRENDERSURFACE_H
00023 
00024 #include "BaseSoftRenderSurface.h"
00025 
00026 //
00027 // SoftRenderSurface
00028 //
00029 // Desc: The class for software rendering in Pentagram
00030 //
00031 template<class uintX> class SoftRenderSurface : public BaseSoftRenderSurface
00032 {
00033 protected:
00034         // Create Generic surface
00035         SoftRenderSurface(int w, int h, int bpp, int rsft, int gsft, int bsft, int asft);
00036 
00037 public:
00038 
00039         // Create from a SDL_Surface
00040         SoftRenderSurface(SDL_Surface *);
00041 
00042         // Create a Generic surface that matches current screen parameters
00043         SoftRenderSurface(int w, int h, uint8 *buf);
00044 
00045         // Create a Render to texture surface
00046         SoftRenderSurface(int w, int h);
00047 
00048         //
00049         // Surface Filling
00050         //
00051 
00052         // Fill buffer (using a palette index)
00053         virtual void Fill8(uint8 index, sint32 sx, sint32 sy, sint32 w, sint32 h);
00054 
00055         // Fill buffer (using a RGB colour)
00056         virtual void Fill32(uint32 rgb, sint32 sx, sint32 sy, sint32 w, sint32 h);
00057 
00059         virtual void FillAlpha(uint8 alpha, sint32 sx, sint32 sy, sint32 w, sint32 h);
00060 
00061         //
00062         // The rule for painting methods:
00063         //
00064         // First arg are the source object to 'draw' with
00065         // Next args are any other required data to define the 'source'
00066         // Next args are the destination position
00067         //
00068 
00069         //
00070         // Basic Shape Painting
00071         //
00072 
00073         // Paint a Shape
00074         // TODO: virtual void Paint(CachedShape* s, uint32 frame, sint32 x, sint32 y);
00075         virtual void Paint(Shape*s, uint32 frame, sint32 x, sint32 y, bool untformed_pal = false);
00076 
00077         // Paint an Shape without clipping
00078         // TODO: virtual void PaintNoClip(CachedShape*s, uint32 frame, sint32 x, sint32 y);
00079         virtual void PaintNoClip(Shape*s, uint32 frame, sint32 x, sint32 y, bool untformed_pal = false);
00080 
00081         // Paint a Translucent Shape. 
00082         // TODO: virtual void PaintTranslucent(CachedShape* s, uint32 frame, sint32 x, sint32 y);
00083         virtual void PaintTranslucent(Shape* s, uint32 frame, sint32 x, sint32 y, bool untformed_pal = false);
00084 
00085         // Paint a Mirrored Shape
00086         // TODO: virtual void PaintMirrored(CachedShape* s, uint32 frame, sint32 x, sint32 y, bool trans = false);
00087         virtual void PaintMirrored(Shape* s, uint32 frame, sint32 x, sint32 y, bool trans = false, bool untformed_pal = false);
00088 
00089         // Paint a Invisible Shape
00090         // TODO: virtual void PaintInvisible(CachedShape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored);
00091         virtual void PaintInvisible(Shape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored, bool untformed_pal = false);
00092 
00093         // Paint a Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level)
00094         // TODO: virtual void PaintHighlight(CachedShape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored, uint32 col32);
00095         virtual void PaintHighlight(Shape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal = false);
00096 
00097         // Paint a Invisible Highlighted Shape of using the 32 Bit Colour col32 (0xAARRGGBB Alpha is blend level)
00098         // TODO: virtual void PaintHighlightInvis(CachedShape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored, uint32 col32);
00099         virtual void PaintHighlightInvis(Shape* s, uint32 frame, sint32 x, sint32 y, bool trans, bool mirrored, uint32 col32, bool untformed_pal = false);
00100 
00101         // Paint a shape masked against destination alpha
00102         virtual void PaintMasked(Shape* s, uint32 framenum, sint32 x, sint32 y, bool trans, bool mirrored, uint32 col32 = 0, bool untformed_pal = false);
00103 
00104 
00105         //
00106         // Basic Line Drawing
00107         //
00108         
00109         // Draw a Line (using a palette index)
00110         // TODO: virtual void DrawLine8(uint8 index, sint32 sx, sint32 sy, sint32 ex, sint32 ey);
00111 
00112         // Draw a RGB Line
00113         virtual void DrawLine32(uint32 rgb, sint32 sx, sint32 sy, sint32 ex, sint32 ey);
00114 
00115 
00116         //
00117         // Basic Font Drawing
00118         //
00119         // Draw FixedWidthFont
00120         virtual void PrintTextFixed(FixedWidthFont *, const char *text, int x, int y);
00121 
00122         // Draw a fixed width character from a FixedWidthFont
00123         virtual void PrintCharFixed(FixedWidthFont *, int character, int x, int y);
00124 
00125 
00126         //
00127         // Basic Texture Blitting
00128         //
00129 
00130         // Blit a region from a Texture (Alpha == 0 -> skipped)
00131         virtual void Blit(Texture *, sint32 sx, sint32 sy, sint32 w, sint32 h, sint32 dx, sint32 dy, bool alpha_blend=false);
00132 
00133         // Blit a region from a Texture with a Colour blend (AlphaTex == 0 -> skipped. AlphaCol32 -> Blend Factors)
00134         virtual void FadedBlit(Texture *, sint32 sx, sint32 sy, sint32 w, sint32 h, sint32 dx, sint32 dy, uint32 col32, bool alpha_blend=false);
00135 
00136         // Blit a region from a Texture with a Colour blend masked based on DestAlpha (AlphaTex == 0 || AlphaDest == 0 -> skipped. AlphaCol32 -> Blend Factors)
00137         virtual void MaskedBlit(Texture *, sint32 sx, sint32 sy, sint32 w, sint32 h, sint32 dx, sint32 dy, uint32 col32, bool alpha_blend=false);
00138 
00139         // Blit a stretched region from a Texture (Alpha == 0 -> skipped)
00140         virtual void StretchBlit(Texture *, sint32 sx, sint32 sy, sint32 sw, sint32 sh, sint32 dx, sint32 dy, sint32 dw, sint32 dh, bool bilinear = false, bool clampedges = false);
00141 
00142         // Blit a region from a Texture using a scaler
00143         virtual bool ScalerBlit(Texture *, sint32 sx, sint32 sy, sint32 sw, sint32 sh, sint32 dx, sint32 dy, sint32 dw, sint32 dh, const Pentagram::Scaler *, bool clampedges = false);
00144 
00146         // TODO: Add in Abstract 3d code Here //
00148 };
00149 
00150 #endif

Generated on Fri Jul 27 22:27:39 2007 for pentagram by  doxygen 1.4.7