CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

rndbuf.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2002 by Mårten Svanfeldt
00003                           Anders Stenberg
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_IVIDEO_RNDBUF_H__
00021 #define __CS_IVIDEO_RNDBUF_H__
00022 
00031 #include "csutil/strset.h"
00032 
00033 #include "ivideo/material.h"
00034 #include "ivideo/render3d.h"
00035 
00036 class csVector3;
00037 class csVector2;
00038 class csColor;
00039 
00040 struct iLightingInfo;
00041 struct iTextureHandle;
00042 
00043 
00048 enum csRenderBufferType
00049 {
00050   CS_BUF_DYNAMIC,
00051   CS_BUF_STATIC,
00052   CS_BUF_INDEX
00053 };
00054 
00056 enum csRenderBufferComponentType
00057 {
00058   CS_BUFCOMP_BYTE,
00059   CS_BUFCOMP_UNSIGNED_BYTE,
00060   CS_BUFCOMP_SHORT,
00061   CS_BUFCOMP_UNSIGNED_SHORT,
00062   CS_BUFCOMP_INT,
00063   CS_BUFCOMP_UNSIGNED_INT,
00064   CS_BUFCOMP_FLOAT,
00065   CS_BUFCOMP_DOUBLE
00066 };
00067 
00073 enum csRenderBufferLockType
00074 {
00075   CS_BUF_LOCK_NOLOCK,
00076   CS_BUF_LOCK_NORMAL,
00077   CS_BUF_LOCK_RENDER
00078 };
00079 
00080 SCF_VERSION (iRenderBuffer, 0, 0, 2);
00081 
00086 struct iRenderBuffer : public iBase
00087 {
00092   virtual void* Lock(csRenderBufferLockType lockType) = 0;
00093 
00095   virtual void Release() = 0;
00096 
00098   virtual int GetComponentCount () = 0;
00099 
00101   virtual csRenderBufferComponentType GetComponentType () = 0;
00102 
00104   virtual bool IsDiscarded() = 0;
00105 
00107   virtual void CanDiscard(bool value) = 0;
00108 
00110   virtual csRenderBufferType GetBufferType() = 0;
00111 
00113   virtual int GetSize() = 0;
00114 
00115 };
00116 
00117 SCF_VERSION (iRenderBufferManager, 0, 0, 2);
00118 
00119 struct iRenderBufferManager : public iBase
00120 {
00122   virtual csPtr<iRenderBuffer> CreateBuffer(int buffersize, 
00123     csRenderBufferType type,
00124     csRenderBufferComponentType comptype,
00125     int compcount) = 0;
00126 
00127 };
00128 
00129 SCF_VERSION (iStreamSource, 0, 0, 1);
00130 
00131 struct iStreamSource : public iBase
00132 {
00134   virtual iRenderBuffer* GetBuffer (csStringID name) = 0;
00135 };
00136 
00138 enum csRenderMeshType
00139 {
00140   CS_MESHTYPE_TRIANGLES,
00141   CS_MESHTYPE_QUADS,
00142   CS_MESHTYPE_TRIANGLESTRIP,
00143   CS_MESHTYPE_TRIANGLEFAN,
00144   CS_MESHTYPE_POINTS,
00145   CS_MESHTYPE_LINES,
00146   CS_MESHTYPE_LINESTRIP
00147 };
00148 
00149 class csRenderMesh
00150 {
00151 public:
00152 
00153 public:
00154 
00155   csRenderMesh () 
00156   {
00157     mixmode = CS_FX_COPY;
00158   }
00159 
00160   virtual ~csRenderMesh () {}
00161 
00162   /*
00163   typedef enum
00164   {
00165     SPECIAL_NONE = 0,
00166     SPECIAL_BILLBOARD = 1,
00167     SPECIAL_ZFILL = 2
00168   } specialattributes;*/
00169 
00171   csZBufMode z_buf_mode;
00172 
00174   uint mixmode;
00175 
00177   int clip_portal;
00178   
00180   int clip_plane;
00181   
00183   int clip_z_plane;
00184 
00186   bool do_mirror;
00187 
00189   csRenderMeshType meshtype;
00190 
00192   unsigned int indexstart;
00193 
00195   unsigned int indexend;
00196 
00198   iStreamSource* streamsource;
00199 
00201   iMaterialHandle* mathandle;
00202 
00204   csReversibleTransform *transform;
00205 };
00206 
00209 #endif // __CS_IVIDEO_RNDBUF_H__

Generated for Crystal Space by doxygen 1.2.14