Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CS_RENDERMESHLIST_H__
00020 #define __CS_RENDERMESHLIST_H__
00021
00026 #include "csextern.h"
00027
00028 #include "csgeom/vector3.h"
00029 #include "csutil/parray.h"
00030
00031 #include "ivideo/graph3d.h"
00032 #include "ivideo/rendermesh.h"
00033
00034 struct iEngine;
00035 struct iMeshWrapper;
00036 struct iObjectRegistry;
00037 struct iRenderView;
00038
00043 class CS_CRYSTALSPACE_EXPORT csRenderMeshList
00044 {
00045 public:
00051 csRenderMeshList (iEngine* engine);
00052
00056 ~csRenderMeshList ();
00057
00061 void AddRenderMeshes (CS::Graphics::RenderMesh** meshes, int num,
00062 CS::Graphics::RenderPriority defaultRenderPriority,
00063 csZBufMode z_buf_mode, iMeshWrapper* mesh);
00064
00069 size_t SortMeshLists (iRenderView *rview);
00070
00074 void GetSortedMeshes (CS::Graphics::RenderMesh** meshes, iMeshWrapper** imeshes);
00075
00079 void Empty ();
00080
00081 private:
00082 struct meshListEntry
00083 {
00084 CS::Graphics::RenderMesh* rm;
00085 iMeshWrapper* mesh;
00086
00087 meshListEntry (CS::Graphics::RenderMesh* mesh, iMeshWrapper* imesh)
00088 : rm(mesh), mesh(imesh) {}
00089 };
00090
00092 struct renderMeshListInfo
00093 {
00095 long renderPriority;
00096
00098 int sortingOption;
00099
00101 csArray<meshListEntry> meshList;
00102
00103 };
00104
00105 csPDelArray < renderMeshListInfo > renderList;
00106 iEngine* engine;
00107
00108 static int SortMeshMaterial (meshListEntry const& me1,
00109 meshListEntry const& me2);
00110 static int SortMeshBack2Front (meshListEntry const& me1,
00111 meshListEntry const& me2);
00112 static int SortMeshFront2Back (meshListEntry const& me1,
00113 meshListEntry const& me2);
00114 static csVector3 sort_CameraPosition;
00115 };
00116
00117 #endif //__CS_RENDERMESHLIST_H__