MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / rend_SetLighting

Function rend_SetLighting

renderer/HardwareOpenGL.cpp:1576–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1574}
1575
1576void rend_SetLighting(light_state state) {
1577 if (state == gpu_state.cur_light_state)
1578 return; // No redundant state setting
1579#if (defined(_USE_OGL_ACTIVE_TEXTURES))
1580 if (UseMultitexture && Last_texel_unit_set != 0) {
1581 oglActiveTextureARB(GL_TEXTURE0_ARB + 0);
1582 Last_texel_unit_set = 0;
1583 }
1584#endif
1585
1586 OpenGL_sets_this_frame[4]++;
1587
1588 switch (state) {
1589 case LS_NONE:
1590 dglShadeModel(GL_SMOOTH);
1591 gpu_state.cur_light_state = LS_NONE;
1592 break;
1593 case LS_FLAT_GOURAUD:
1594 dglShadeModel(GL_SMOOTH);
1595 gpu_state.cur_light_state = LS_FLAT_GOURAUD;
1596 break;
1597 case LS_GOURAUD:
1598 case LS_PHONG:
1599 dglShadeModel(GL_SMOOTH);
1600 gpu_state.cur_light_state = LS_GOURAUD;
1601 break;
1602 default:
1603 Int3();
1604 break;
1605 }
1606
1607 CHECK_ERROR(13)
1608}
1609
1610void rend_SetColorModel(color_model state) {
1611 switch (state) {

Callers 15

g3_DrawRotatedBitmapFunction · 0.70
rend_DrawSimpleBitmapFunction · 0.70
rend_DrawLineFunction · 0.70
DrawPolygonModelFunction · 0.50
RenderSubmodelFaceFunction · 0.50
DrawThrusterEffectFunction · 0.50
DrawGlowEffectFunction · 0.50
RenderSubmodelFunction · 0.50
CheckRoomFunction · 0.50
ui_DoCursorFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected