csplugincommon/softshader/scanline.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2005 by Jorrit Tyberghein 00003 (C) 2005 by Frank Richter 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_CSPLUGINCOMMON_SOFTSHADER_SCANLINE_H__ 00021 #define __CS_CSPLUGINCOMMON_SOFTSHADER_SCANLINE_H__ 00022 00027 #include "ivideo/rendermesh.h" 00028 00029 #include "texture.h" 00030 #include "types.h" 00031 00035 namespace CS 00036 { 00037 namespace PluginCommon 00038 { 00039 namespace SoftShader 00040 { 00044 struct iScanlineRenderer : public virtual iBase 00045 { 00046 public: 00047 SCF_INTERFACE(iScanlineRenderer, 0, 1, 0); 00048 00062 typedef void (*ScanlineProc) (iScanlineRenderer* _This, 00063 InterpolateEdgePersp& L, InterpolateEdgePersp& R, 00064 int ipolStep, int ipolShift, 00065 uint32* dest, uint len, uint32 *zbuff); 00066 00071 struct RenderInfoMesh 00072 { 00074 iScanlineRenderer* renderer; 00076 BuffersMask desiredBuffers; 00078 const size_t* bufferComps; 00079 }; 00080 00085 struct RenderInfoTriangle 00086 { 00088 ScanlineProc proc; 00090 csVector4* denormFactors; 00092 BuffersMask denormBuffers; 00093 }; 00094 00099 virtual bool SetupMesh (TexturesMask availableTextures, 00100 BuffersMask availableBuffers, const csRenderMeshModes& modes, 00101 bool needColors, RenderInfoMesh& renderInfoMesh) = 0; 00106 virtual bool SetupTriangle (SoftwareTexture** textures, 00107 const RenderInfoMesh& renderInfoMesh, 00108 RenderInfoTriangle& renderInfoTri) = 0; 00109 }; 00110 00114 struct iDefaultScanlineRenderer : public virtual iBase 00115 { 00116 public: 00117 SCF_INTERFACE(iDefaultScanlineRenderer, 0, 1, 1); 00118 00122 virtual void SetFlatColor (const csVector4& v) = 0; 00129 virtual void SetShift (int rgbShift, int alphaShift) = 0; 00131 virtual void SetColorSum (bool enable) = 0; 00132 }; 00133 } // namespace SoftShader 00134 } // namespace PluginCommon 00135 } // namespace CS 00136 00139 #endif // __CS_CSPLUGINCOMMON_SOFTSHADER_SCANLINE_H__
Generated for Crystal Space by doxygen 1.4.7