Commit 51b910d9 authored by sumpfralle's avatar sumpfralle

added another OpenGL setting ("use caching") - this should solve the problem...

added another OpenGL setting ("use caching") - this should solve the problem reported by a Windows user:
* http://sourceforge.net/tracker/index.php?func=detail&aid=3465407&group_id=237831&atid=1104176


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1226 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 5efcbfb2
......@@ -134,6 +134,20 @@
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="OpenGLCache">
<property name="label" translatable="yes">Use caching</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">OpenGL caching (via Display Lists) works without problems for most users. But if your 3D view is distorted or not usable at all, then you should consider to disable caching. The cache improves performance significantly.</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
</object>
......
......@@ -92,9 +92,12 @@ class OpenGLViewModel(pycam.Plugins.PluginBase):
GL.GL_AMBIENT_AND_DIFFUSE, color)
# we need to wait until the color change is active
GL.glFinish()
if self.core.get("opengl_cache_enable"):
key = self._get_cache_key(model, color=color,
show_directions=self.core.get("show_directions"))
do_caching = not key is None
else:
do_caching = False
if do_caching and not key in self._cache:
# Rendering a display list takes less than 5% of the time
# for a complete rebuild.
......
......@@ -98,7 +98,8 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
("view_light", "OpenGLLight", True),
("view_shadow", "OpenGLShadow", True),
("view_polygon", "OpenGLPolygon", True),
("view_perspective", "OpenGLPerspective", True)):
("view_perspective", "OpenGLPerspective", True),
("opengl_cache_enable", "OpenGLCache", True)):
obj = self.gui.get_object(objname)
self.core.add_item(name, obj.get_active, obj.set_active)
obj.set_active(default)
......@@ -217,7 +218,8 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
set_func = lambda value: self.core.set(name, value)
return get_func, set_func
for name in ("view_light", "view_shadow", "view_polygon",
"view_perspective", "drill_progress_max_fps"):
"view_perspective", "opengl_cache_enable",
"drill_progress_max_fps"):
self.register_state_item("settings/view/opengl/%s" % name,
*get_get_set_functions(name))
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment