[Bf-blender-cvs] [363ea3a1ce6] blender2.8: Remove deprecated GL_LIGHTING chunk from manipulator draw code.

Bastien Montagne noreply at git.blender.org
Tue Apr 18 15:00:26 CEST 2017


Commit: 363ea3a1ce6e6288d390a7217b736f0ddf93265f
Author: Bastien Montagne
Date:   Tue Apr 18 14:57:09 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB363ea3a1ce6e6288d390a7217b736f0ddf93265f

Remove deprecated GL_LIGHTING chunk from manipulator draw code.

This is new feature, will likely need own shader to get same result.
Just commented it as TODO, though, this is not high priority.

Part of T51164.

===================================================================

M	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c

===================================================================

diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
index 196f707d8d5..ec6e6c3cb2f 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
@@ -241,28 +241,14 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
 	BLI_assert(!BLI_listbase_is_empty(&mmap->manipulator_groups));
 
 	const bool draw_multisample = (U.ogl_multisamples != USER_MULTISAMPLE_NONE);
-	const bool use_lighting = (U.manipulator_flag & V3D_SHADED_MANIPULATORS) != 0;
+
+	/* TODO this will need it own shader probably? don't think it can be handled from that point though. */
+/*	const bool use_lighting = (U.manipulator_flag & V3D_SHADED_MANIPULATORS) != 0; */
 
 	/* enable multisampling */
 	if (draw_multisample) {
 		glEnable(GL_MULTISAMPLE);
 	}
-	if (use_lighting) {
-		const float lightpos[4] = {0.0, 0.0, 1.0, 0.0};
-		const float diffuse[4] = {1.0, 1.0, 1.0, 0.0};
-
-		glPushAttrib(GL_LIGHTING_BIT | GL_ENABLE_BIT);
-
-		glEnable(GL_LIGHTING);
-		glEnable(GL_LIGHT0);
-		glEnable(GL_COLOR_MATERIAL);
-		glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
-		gpuPushMatrix();
-		gpuLoadIdentity();
-		glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
-		glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
-		gpuPopMatrix();
-	}
 
 	/* draw_manipulators contains all visible manipulators - draw them */
 	for (LinkData *link = draw_manipulators->first, *link_next; link; link = link_next) {
@@ -277,9 +263,6 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
 	if (draw_multisample) {
 		glDisable(GL_MULTISAMPLE);
 	}
-	if (use_lighting) {
-		glPopAttrib();
-	}
 }
 
 void WM_manipulatormap_draw(wmManipulatorMap *mmap, const bContext *C, const int drawstep)




More information about the Bf-blender-cvs mailing list