MCPcopy Create free account
hub / github.com/OGRECave/ogre / _setSurfaceTracking

Method _setSurfaceTracking

RenderSystems/GL/src/OgreGLRenderSystem.cpp:1189–1231  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1187 }
1188 //-----------------------------------------------------------------------------
1189 void GLRenderSystem::_setSurfaceTracking(TrackVertexColourType tracking)
1190 {
1191
1192 // Track vertex colour
1193 if(tracking != TVC_NONE)
1194 {
1195 GLenum gt = GL_DIFFUSE;
1196 // There are actually 15 different combinations for tracking, of which
1197 // GL only supports the most used 5. This means that we have to do some
1198 // magic to find the best match. NOTE:
1199 // GL_AMBIENT_AND_DIFFUSE != GL_AMBIENT | GL__DIFFUSE
1200 if(tracking & TVC_AMBIENT)
1201 {
1202 if(tracking & TVC_DIFFUSE)
1203 {
1204 gt = GL_AMBIENT_AND_DIFFUSE;
1205 }
1206 else
1207 {
1208 gt = GL_AMBIENT;
1209 }
1210 }
1211 else if(tracking & TVC_DIFFUSE)
1212 {
1213 gt = GL_DIFFUSE;
1214 }
1215 else if(tracking & TVC_SPECULAR)
1216 {
1217 gt = GL_SPECULAR;
1218 }
1219 else if(tracking & TVC_EMISSIVE)
1220 {
1221 gt = GL_EMISSION;
1222 }
1223 glColorMaterial(GL_FRONT_AND_BACK, gt);
1224
1225 mStateCacheManager->setEnabled(GL_COLOR_MATERIAL, true);
1226 }
1227 else
1228 {
1229 mStateCacheManager->setEnabled(GL_COLOR_MATERIAL, false);
1230 }
1231 }
1232 //-----------------------------------------------------------------------------
1233 void GLRenderSystem::_setPointParameters(bool attenuationEnabled, Real minSize, Real maxSize)
1234 {

Callers

nothing calls this directly

Calls 1

setEnabledMethod · 0.45

Tested by

no test coverage detected