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

Function rend_SetLightingState

renderer/HardwareOpenGL.cpp:1869–1902  ·  view source on GitHub ↗

Sets the lighting state of opengl

Source from the content-addressed store, hash-verified

1867
1868// Sets the lighting state of opengl
1869void rend_SetLightingState(light_state state) {
1870 if (state == gpu_state.cur_light_state)
1871 return; // No redundant state setting
1872
1873 if (UseMultitexture && Last_texel_unit_set != 0) {
1874#if (defined(_USE_OGL_ACTIVE_TEXTURES))
1875 oglActiveTextureARB(GL_TEXTURE0_ARB + 0);
1876 Last_texel_unit_set = 0;
1877#endif
1878 }
1879
1880 OpenGL_sets_this_frame[4]++;
1881
1882 switch (state) {
1883 case LS_NONE:
1884 dglShadeModel(GL_SMOOTH);
1885 gpu_state.cur_light_state = LS_NONE;
1886 break;
1887 case LS_FLAT_GOURAUD:
1888 dglShadeModel(GL_SMOOTH);
1889 gpu_state.cur_light_state = LS_FLAT_GOURAUD;
1890 break;
1891 case LS_GOURAUD:
1892 case LS_PHONG:
1893 dglShadeModel(GL_SMOOTH);
1894 gpu_state.cur_light_state = LS_GOURAUD;
1895 break;
1896 default:
1897 Int3();
1898 break;
1899 }
1900
1901 CHECK_ERROR(13)
1902}
1903
1904void rend_SetAlphaType(int8_t atype) {
1905 if (atype == gpu_state.cur_alpha_type)

Callers 1

opengl_SetDefaultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected