00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_RENDERER_H
00012 #define CAL_RENDERER_H
00013
00014
00015 #include "cal3d/global.h"
00016
00017
00018 class CalModel;
00019 class CalSubmesh;
00020
00021
00022 class CAL3D_API CalRenderer
00023 {
00024 public:
00025 CalRenderer(CalModel *pModel);
00026 CalRenderer(CalRenderer *pRenderer);
00027 ~CalRenderer() { }
00028
00029 bool beginRendering();
00030 void endRendering();
00031 void getAmbientColor(unsigned char *pColorBuffer) const;
00032 void getDiffuseColor(unsigned char *pColorBuffer) const;
00033 int getFaceCount() const;
00034 int getFaces(CalIndex *pFaceBuffer) const;
00035 int getMapCount() const;
00036 Cal::UserData getMapUserData(int mapId);
00037 const Cal::UserData getMapUserData(int mapId) const;
00038 int getMeshCount() const;
00039 int getNormals(float *pNormalBuffer, int stride=0) const;
00040 float getShininess() const;
00041 void getSpecularColor(unsigned char *pColorBuffer) const;
00042 int getSubmeshCount(int meshId) const;
00043 int getTextureCoordinates(int mapId, float *pTextureCoordinateBuffer, int stride=0) const;
00044 int getVertexCount() const;
00045 int getVertices(float *pVertexBuffer, int stride=0) const;
00046 int getTangentSpaces(int mapId, float *pTangentSpaceBuffer, int stride=0) const;
00047 int getVertColors(float *pVertexBuffer);
00048 int getVertColorsAsStandardPixels( unsigned int *pVertexBuffer);
00049 int getVerticesAndNormals(float *pVertexBuffer, int stride=0) const;
00050 int getVerticesNormalsAndTexCoords(float *pVertexBuffer,int NumTexCoords=1) const;
00051 bool isTangentsEnabled(int mapId) const;
00052 bool selectMeshSubmesh(int meshId, int submeshId);
00053 void setNormalization(bool normalize);
00054 bool textureCoordinatesForMapValid( int mapId );
00055 bool hasNonWhiteVertexColors();
00056
00057 private:
00058 CalModel *m_pModel;
00059 CalSubmesh *m_pSelectedSubmesh;
00060 };
00061
00062 #endif
00063
00064