- Cal3D 0.11 API Reference -

renderer.h
1//****************************************************************************//
2// renderer.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_RENDERER_H
12#define CAL_RENDERER_H
13
14
15#include "cal3d/global.h"
16
17
18class CalModel;
19class CalSubmesh;
20
21
22class CAL3D_API CalRenderer
23{
24public:
25 CalRenderer(CalModel *pModel);
26 CalRenderer(CalRenderer *pRenderer);
27 ~CalRenderer() { }
28
29 bool beginRendering();
30 void endRendering();
31 void getAmbientColor(unsigned char *pColorBuffer) const;
32 void getDiffuseColor(unsigned char *pColorBuffer) const;
33 int getFaceCount() const;
34 int getFaces(CalIndex *pFaceBuffer) const;
35 int getMapCount() const;
36 Cal::UserData getMapUserData(int mapId);
37 const Cal::UserData getMapUserData(int mapId) const;
38 int getMeshCount() const;
39 int getNormals(float *pNormalBuffer, int stride=0) const;
40 float getShininess() const;
41 void getSpecularColor(unsigned char *pColorBuffer) const;
42 int getSubmeshCount(int meshId) const;
43 int getTextureCoordinates(int mapId, float *pTextureCoordinateBuffer, int stride=0) const;
44 int getVertexCount() const;
45 int getVertices(float *pVertexBuffer, int stride=0) const;
46 int getTangentSpaces(int mapId, float *pTangentSpaceBuffer, int stride=0) const;
47 int getVertColors(float *pVertexBuffer);
48 int getVertColorsAsStandardPixels( unsigned int *pVertexBuffer);
49 int getVerticesAndNormals(float *pVertexBuffer, int stride=0) const;
50 int getVerticesNormalsAndTexCoords(float *pVertexBuffer,int NumTexCoords=1) const;
51 bool isTangentsEnabled(int mapId) const;
52 bool selectMeshSubmesh(int meshId, int submeshId);
53 void setNormalization(bool normalize);
54 bool textureCoordinatesForMapValid( int mapId );
55 bool hasNonWhiteVertexColors();
56
57private:
58 CalModel *m_pModel;
59 CalSubmesh *m_pSelectedSubmesh;
60};
61
62#endif
63
64//****************************************************************************//
Definition model.h:31
int getVerticesNormalsAndTexCoords(float *pVertexBuffer, int NumTexCoords=1) const
Provides access to the submesh data.
Definition renderer.cpp:775
bool isTangentsEnabled(int mapId) const
Returns if tangent are enabled.
Definition renderer.cpp:582
void endRendering()
Finishes the rendering query phase.
Definition renderer.cpp:96
bool textureCoordinatesForMapValid(int mapId)
Returns true if texture coordinates exist for the given map.
Definition renderer.cpp:551
void getDiffuseColor(unsigned char *pColorBuffer) const
Provides access to the diffuse color.
Definition renderer.cpp:148
int getVerticesAndNormals(float *pVertexBuffer, int stride=0) const
Provides access to the submesh data.
Definition renderer.cpp:727
int getFaces(CalIndex *pFaceBuffer) const
Provides access to the face data.
Definition renderer.cpp:198
void getAmbientColor(unsigned char *pColorBuffer) const
Provides access to the ambient color.
Definition renderer.cpp:112
int getMapCount() const
Returns the number of maps.
Definition renderer.cpp:211
int getFaceCount() const
Returns the number of faces.
Definition renderer.cpp:182
int getVertices(float *pVertexBuffer, int stride=0) const
Provides access to the vertex data.
Definition renderer.cpp:598
int getTextureCoordinates(int mapId, float *pTextureCoordinateBuffer, int stride=0) const
Provides access to the texture coordinate data.
Definition renderer.cpp:505
int getNormals(float *pNormalBuffer, int stride=0) const
Provides access to the normal data.
Definition renderer.cpp:375
int getVertexCount() const
Returns the number of vertices.
Definition renderer.cpp:569
CalRenderer(CalModel *pModel)
Constructs the renderer instance.
Definition renderer.cpp:40
void setNormalization(bool normalize)
Sets the normalization flag to true or false.
Definition renderer.cpp:891
float getShininess() const
Returns the shininess factor.
Definition renderer.cpp:420
int getTangentSpaces(int mapId, float *pTangentSpaceBuffer, int stride=0) const
Provides access to the tangent space data.
Definition renderer.cpp:318
int getMeshCount() const
Returns the number of attached meshes.
Definition renderer.cpp:296
void getSpecularColor(unsigned char *pColorBuffer) const
Provides access to the specular color.
Definition renderer.cpp:440
bool beginRendering()
Initializes the rendering query phase.
Definition renderer.cpp:68
int getVertColors(float *pVertexBuffer)
Provides access to the vertex colors.
Definition renderer.cpp:646
bool selectMeshSubmesh(int meshId, int submeshId)
Selects a mesh/submesh for rendering data queries.
Definition renderer.cpp:864
Cal::UserData getMapUserData(int mapId)
Provides access to a specified map user data.
Definition renderer.cpp:234
int getSubmeshCount(int meshId) const
Returns the number of submeshes.
Definition renderer.cpp:477
Definition submesh.h:30

Generated by The Cal3D Team with Doxygen 1.13.1