[Bf-blender-cvs] [53cfd47] temp_viewport_fx_merge: fix another Mac crasher

Mike Erwin noreply at git.blender.org
Thu Apr 2 02:29:20 CEST 2015


Commit: 53cfd4761c896399a81b7eb4d0974161fdd756c1
Author: Mike Erwin
Date:   Wed Apr 1 20:28:23 2015 -0400
Branches: temp_viewport_fx_merge
https://developer.blender.org/rB53cfd4761c896399a81b7eb4d0974161fdd756c1

fix another Mac crasher

According to LLDB everything we pass to glVertexPointer and
glDrawElements seems perfectly OK, but for some reason it crashes in
the driver.

With this change I was finally able to run this branch! Until sync-ing
with today’s matrix module.

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

M	source/blender/editors/interface/interface_widgets.c

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 148adb6..5886ac8 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -539,10 +539,18 @@ static void widget_scroll_circle(uiWidgetTrias *tria, const rcti *rect, float tr
 
 static void widget_trias_draw(uiWidgetTrias *tria)
 {
+#if 0 /* no idea why this crashes on Mac, everything seems to check out ok --merwin */
 	glEnableClientState(GL_VERTEX_ARRAY);
 	glVertexPointer(2, GL_FLOAT, 0, tria->vec);
 	glDrawElements(GL_TRIANGLES, tria->tot * 3, GL_UNSIGNED_INT, tria->index);
 	glDisableClientState(GL_VERTEX_ARRAY);
+#else
+	const unsigned *idx = (const unsigned *)tria->index;
+	glBegin(GL_TRIANGLES);
+	for (unsigned i = 0; i < tria->tot * 3; ++i)
+		glVertex3fv((float *)&tria->vec[idx[i]]);
+	glEnd();
+#endif
 }
 
 static void widget_menu_trias(uiWidgetTrias *tria, const rcti *rect)




More information about the Bf-blender-cvs mailing list