00001 #include <clu.h>
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 GLvoid cluRenderMesh(CLmesh* mesh)
00012 {
00013 GLboolean lighting_flag;
00014 GLboolean textured_flag;
00015
00016 glPushAttrib(GL_ENABLE_BIT);
00017
00018
00019 lighting_flag = GL_TRUE;
00020
00021 lighting_flag &= clIsEnabled(CL_MATERIAL |
00022 CL_NORMALS);
00023
00024 lighting_flag &= CL_BOOLEAN(mesh->normals);
00025 lighting_flag &= mesh->material_index != -1;
00026
00027
00028 textured_flag = GL_TRUE;
00029
00030 textured_flag &= clIsEnabled(CL_TEXTURE
00031 | CL_TEXTURE_ENV_MODE
00032 | CL_TEXCOORDS);
00033
00034 textured_flag &= CL_BOOLEAN(mesh->texcoords);
00035 textured_flag &= mesh->texture_index != -1;
00036
00037 clRenderMesh(mesh);
00038
00039 glPopAttrib();
00040 }
00041
00042 GLvoid cluRenderModel(CLmodel* model)
00043 {
00044 unsigned int i;
00045
00046 for (i = 0; i < model->num_meshes; i++)
00047 cluRenderMesh(model->meshes[i]);
00048 }
00049