## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# 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 CrystalSpace
    00036 {
    00037   namespace SoftShader
    00038   {
    00042     struct iScanlineRenderer : public virtual iBase
    00043     {
    00044     public:
    00045       SCF_INTERFACE(iScanlineRenderer, 0, 1, 0);
    00046
    00060       typedef void (*ScanlineProc) (iScanlineRenderer* _This,
    00061         InterpolateEdgePersp& L, InterpolateEdgePersp& R,
    00062         int ipolStep, int ipolShift,
    00063         uint32* dest, uint len, uint32 *zbuff);
    00064
    00069       struct RenderInfoMesh
    00070       {
    00072         iScanlineRenderer* renderer;
    00074         BuffersMask desiredBuffers;
    00076         const size_t* bufferComps;
    00077       };
    00078
    00083       struct RenderInfoTriangle
    00084       {
    00086         ScanlineProc proc;
    00088         csVector4* denormFactors;
    00090         BuffersMask denormBuffers;
    00091       };
    00092
    00097       virtual bool SetupMesh (TexturesMask availableTextures,
    00098         BuffersMask availableBuffers, const csRenderMeshModes& modes,
    00099         bool needColors, RenderInfoMesh& renderInfoMesh) = 0;
    00104       virtual bool SetupTriangle (SoftwareTexture** textures,
    00105         const RenderInfoMesh& renderInfoMesh,
    00106         RenderInfoTriangle& renderInfoTri) = 0;
    00107     };
    00108
    00112     struct iDefaultScanlineRenderer : public virtual iBase
    00113     {
    00114     public:
    00115       SCF_INTERFACE(iDefaultScanlineRenderer, 0, 1, 0);
    00116
    00120       virtual void SetFlatColor (const csVector4& v) = 0;
    00127       virtual void SetShift (int rgbShift, int alphaShift) = 0;
    00128     };
    00129   } // namespace SoftShader
    00130 } // namespace CrystalSpace
    00131
    00134 #endif // __CS_CSPLUGINCOMMON_SOFTSHADER_SCANLINE_H__